CN110855785A - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN110855785A
CN110855785A CN201911124034.0A CN201911124034A CN110855785A CN 110855785 A CN110855785 A CN 110855785A CN 201911124034 A CN201911124034 A CN 201911124034A CN 110855785 A CN110855785 A CN 110855785A
Authority
CN
China
Prior art keywords
information
service request
connection information
online
user
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911124034.0A
Other languages
Chinese (zh)
Other versions
CN110855785B (en
Inventor
周子贻
余程
吴佳鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Li Zhi Network Technology Co Ltd
Original Assignee
Guangzhou Li Zhi Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Li Zhi Network Technology Co Ltd filed Critical Guangzhou Li Zhi Network Technology Co Ltd
Priority to CN201911124034.0A priority Critical patent/CN110855785B/en
Publication of CN110855785A publication Critical patent/CN110855785A/en
Application granted granted Critical
Publication of CN110855785B publication Critical patent/CN110855785B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Abstract

The application relates to a data processing method and a device, and when the method is applied to management service, the method comprises the following steps: receiving a service request and connection information sent by gateway equipment, wherein the service request comprises Session information, and the service request is obtained by copying the service request after the gateway equipment receives the service request from a client; analyzing user information from the Session information; judging whether the user information is in a generated online user list or not; if not, recording the user information and the connection information in the online user list, wherein the user information is associated with the connection information in the online user list. The management service can realize the recording of the online state of the client without interacting with the client in the whole process, thereby avoiding the condition that the user information record is out of date caused by packet loss and the like in the communication process with the client and ensuring the timely recording of the online state.

Description

Data processing method and device
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method and an apparatus for data processing.
Background
With the development of internet technology, online users of application programs APP are more and more, so that services such as whether the users are online or not and information is pushed to the online users are more and more.
In the related art, the manner of determining whether a user is online is as follows: the user sends a registration message of an online state after connecting with the server, the service records the online information of the user after receiving the message, and the user also needs to send an offline message notification service before offline. The process needs to consume multiple requests and responses, the transmission times are increased, network resources are consumed, packet loss and other situations can occur when the network is not smooth, and the online state of the user cannot be refreshed instantly.
Disclosure of Invention
In view of the above, the present application is proposed to provide a method and apparatus for data processing that overcomes or at least partially solves the above problems.
In a first aspect, the present application provides a data processing method, which is applied to a management service, where the management service is connected to a gateway device, and the method includes:
receiving a service request and connection information sent by gateway equipment, wherein the service request comprises Session information, and the service request is obtained by copying the service request after the gateway equipment receives the service request from a client;
analyzing user information from the Session information;
judging whether the user information is in a generated online user list or not;
if not, recording the user information and the connection information in the online user list, wherein the user information is associated with the connection information in the online user list.
Optionally, the method further comprises:
if the user information is judged to be in the generated online user list, acquiring prior connection information associated with the user information from the online user list;
judging whether the prior connection information is consistent with the connection information sent by the gateway equipment or not;
and if the connection information is inconsistent with the previous connection information, replacing the previous connection information with the connection information sent by the gateway equipment.
Optionally, if it is determined that the previous connection information is inconsistent with the connection information sent by the gateway device, the method further includes:
and sending an offline operation notification to the gateway device, wherein the offline operation notification is used for notifying the gateway device to perform offline processing on the connection corresponding to the prior connection information.
Optionally, the method further comprises:
receiving an offline notification message sent by the gateway device, wherein the offline notification message comprises target connection information, and the offline notification message is generated when the gateway device detects that the connection with the client is disconnected;
and searching the target connection information in the online user list, and deleting the target connection information and the corresponding user information from the online user list.
Optionally, the method further comprises:
and after analyzing the user information from the Session information, sending a forwarding stopping notification to the gateway equipment, wherein the forwarding stopping notification is used for notifying the gateway equipment to stop forwarding other service requests except the preset service request of the specified type.
Optionally, the method further comprises:
receiving an online query request;
and returning the online user list according to the online query request, or returning a query result corresponding to the online query request.
In a second aspect, the present application provides a data processing method, which is applied in a gateway device, and the method includes:
receiving a service request sent by a client, wherein the service request comprises Session information;
generating connection information according to the service request;
and copying the service request, and sending the copied service request and the connection information to a management service, wherein the management service is used for analyzing user information from the Session information and recording the user information and the corresponding connection information in a generated online user list.
Optionally, the method further comprises:
when the disconnection with the client is detected, generating an offline notification message, wherein the offline notification message comprises target connection information;
and sending the offline notification message to the management service, wherein the offline notification message is used for notifying the management service to delete the target connection information and the corresponding user information from the online user list.
Optionally, the method further comprises:
and sending the service request to a service, and carrying out corresponding service processing by the service according to a preset service logic.
Optionally, after sending the copied service request and the connection information to a management service, the method further includes:
receiving an offline operation notification sent by the management service, wherein the offline operation notification is a notification generated when the management service acquires previous connection information recorded in the online user list according to the user information and the received connection information are inconsistent;
and performing offline processing on the connection corresponding to the prior connection information according to the offline operation notification.
Optionally, after sending the copied service request and the connection information to a management service, the method further includes:
receiving a forwarding stop notification sent by the management service;
and stopping forwarding other service requests except the preset service request of the specified type according to the forwarding stopping notification.
In a third aspect, the present application provides an apparatus for data processing, where the apparatus is applied to a management service, and the management service is connected to a gateway device, and the apparatus includes:
the system comprises an information receiving module, a service request processing module and a service request processing module, wherein the information receiving module is used for receiving a service request and connection information sent by gateway equipment, the service request comprises Session information, and the service request is obtained by copying the service request after the gateway equipment receives the service request from a client;
the user information analysis module is used for analyzing the user information from the Session information;
the online judging module is used for judging whether the user information is in the generated online user list or not; if not, calling an online recording module;
and the online recording module is used for recording the user information and the connection information in the online user list, and the user information and the connection information are associated in the online user list.
Optionally, the apparatus further comprises:
a previous connection information obtaining module, configured to obtain, if it is determined that the user information is in the generated online user list, previous connection information associated with the user information from the online user list;
the connection information judging module is used for judging whether the prior connection information is consistent with the connection information sent by the gateway equipment or not; if not, calling a connection information updating module;
and the connection information updating module is used for replacing the prior connection information with the connection information sent by the gateway equipment.
Optionally, the apparatus further comprises:
and the offline operation notification sending module is used for sending an offline operation notification to the gateway device if the prior connection information is judged to be inconsistent with the connection information sent by the gateway device, wherein the offline operation notification is used for notifying the gateway device to perform offline processing on the connection corresponding to the prior connection information.
Optionally, the apparatus further comprises:
an offline notification message receiving module, configured to receive an offline notification message sent by the gateway device, where the offline notification message includes target connection information, and the offline notification message is a message generated when the gateway device detects that the connection with the client is disconnected;
and the online record deleting module is used for searching the target connection information in the online user list and deleting the target connection information and the corresponding user information from the online user list.
Optionally, the apparatus further comprises:
and the transmission stopping notification sending module is used for sending a transmission stopping notification to the gateway equipment after the user information is analyzed from the Session information, wherein the transmission stopping notification is used for notifying the gateway equipment to stop transmitting other service requests except the preset service request of the specified type.
Optionally, the apparatus further comprises:
the query module is used for receiving an online query request; and returning the online user list according to the online query request, or returning a query result corresponding to the online query request.
In a fourth aspect, the present application provides an apparatus for data processing, where the apparatus is applied in a gateway device, and the apparatus includes:
the service request receiving module is used for receiving a service request sent by a client, wherein the service request comprises Session information;
the connection information generating module is used for generating connection information according to the service request;
and the information sending module is used for copying the service request, sending the copied service request and the connection information to a management service, and the management service is used for analyzing the user information from the Session information and recording the user information and the corresponding connection information in the generated online user list.
Optionally, the apparatus further comprises:
the offline notification module is used for generating an offline notification message when the disconnection of the client is detected, wherein the offline notification message comprises target connection information; and sending the offline notification message to the management service, wherein the offline notification message is used for notifying the management service to delete the target connection information and the corresponding user information from the online user list.
Optionally, the apparatus further comprises:
and the service request sending module is used for sending the service request to a service, and the service performs corresponding service processing according to a preset service logic.
Optionally, the apparatus further comprises:
the offline processing module is used for receiving an offline operation notification sent by the management service after the copied service request and the connection information are sent to the management service, wherein the offline operation notification is a notification generated when the management service acquires the previous connection information recorded in the online user list according to the user information and the received connection information are inconsistent; and performing offline processing on the connection corresponding to the prior connection information according to the offline operation notification.
Optionally, the apparatus further comprises:
a stop forwarding module, configured to receive a stop forwarding notification sent by a management service after the service request obtained by copying and the connection information are sent to the management service; and stopping forwarding other service requests except the preset service request of the specified type according to the forwarding stopping notification.
In a fifth aspect, the present application further provides an electronic device, including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method as described above.
In a sixth aspect, the present application also provides a storage medium, wherein instructions of the storage medium, when executed by a processor of the device, enable the electronic device to perform the method as described above.
The application has the following beneficial effects:
in this embodiment, the management service parses the user information by receiving the service request sent by the gateway device, and if it is determined that the user information is not in the online user list generated in advance, the user information and the connection information sent by the gateway device are recorded together in the online user list.
Drawings
Fig. 1 is a flowchart illustrating a first step of a data processing method according to an embodiment of the present application;
FIG. 2 is a diagram of a system architecture in which management services according to an embodiment of the present application are located;
FIG. 3 is a flowchart illustrating steps of a second embodiment of a data processing method according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating a third embodiment of a method for data processing according to an embodiment of the present disclosure;
FIG. 5 is a flowchart illustrating a fourth step of an embodiment of a method for data processing according to the present application;
FIG. 6 is a flowchart illustrating a fifth step of an embodiment of a method for data processing according to the present application;
FIG. 7 is a flowchart illustrating steps of a sixth embodiment of a method for data processing according to an embodiment of the present application;
FIG. 8 is a block diagram of an embodiment of a data processing apparatus according to an embodiment of the present application;
fig. 9 is a block diagram of another data processing apparatus according to an embodiment of the present application.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, the present application is described in further detail with reference to the accompanying drawings and the detailed description.
Referring to fig. 1, a flowchart of a first step of a data processing method embodiment of the present application is shown, where the present embodiment may be applied to a management service, where the management service is used to manage an online state of a client, and as shown in fig. 2, the management service is connected to a gateway device, and the gateway device may interact with an application APP client, and meanwhile, the gateway device may also be connected to a business service.
The present embodiment may include the following steps:
step 101, receiving a service request and connection information sent by a gateway device, where the service request includes Session information.
In this embodiment, the service request is a request obtained by copying the service request after the gateway device receives the service request from the client. Specifically, after receiving a service request sent by a client, the gateway device may copy the service request, and then send the copied service request and connection information obtained according to the service request to the management service.
As an example, the connection information may include, but is not limited to: a gateway identity and a connection identity. The gateway identifier is used for locating gateway information to which the current connection belongs, and may include, but is not limited to, an IP address of the gateway, a port number of the gateway, and the like; and the connection identifier is used to identify the current connection between the client and the gateway, and in one example, the connection identifier may be a connection ID, which is a hash value of (IP address of the client + port number of the client + IP address of the gateway + port number of the gateway).
And 102, analyzing user information from the Session information.
In this embodiment, the protocol of the service request may include Session information, device information, and service data, where the Session information may be generated by a customized algorithm according to user information. Then, after the management service receives the service request, Session information may be obtained from the service request, and then the Session information may be parsed to obtain user information.
Illustratively, the user information may include, but is not limited to: user ID, device ID (including IP address, port number, etc. of the client).
Step 103, judging whether the user information is in the generated online user list.
The embodiment may maintain an online user list, in which user information of a client currently in an online state and corresponding connection information are recorded. In step 103, after the management service obtains the user information, the user information may be searched in the online user list, if the search is successful, it indicates that the client corresponding to the user information is already in an online state before, and if the search is failed, it indicates that the client corresponding to the user information is not already in an online state before.
And 104, if not, recording the user information and the connection information in the online user list, wherein the user information is associated with the connection information in the online user list.
In this step, if the management service determines that the current user information is not in the online user list, the user information and the corresponding connection information may be directly recorded in the online user list, and the user information and the connection information may be associated in the online user list.
In this embodiment, the management service parses the user information by receiving the service request sent by the gateway device, and if it is determined that the user information is not in the online user list generated in advance, the user information and the connection information sent by the gateway device are recorded together in the online user list.
Referring to fig. 3, a flowchart illustrating a step of a second embodiment of a data processing method according to an embodiment of the present application is shown, where the present embodiment may be applied to a management service, and the present embodiment may include the following steps:
step 301, receiving a service request and connection information sent by a gateway device, where the service request includes Session information, and the service request is obtained by copying the service request after the gateway device receives the service request from a client.
Step 302, analyzing user information from the Session information;
step 303, determining whether the user information is in the generated online user list. If not, go to step 304, and if yes, go to step 305.
Step 304, recording the user information and the connection information in the online user list, wherein the user information is associated with the connection information in the online user list.
Step 305, obtaining prior connection information associated with the user information from the online user list; judging whether the prior connection information is consistent with the connection information sent by the gateway equipment or not; and if the connection information is inconsistent with the previous connection information, replacing the previous connection information with the connection information sent by the gateway equipment.
In this embodiment, if the management service determines that the current user information exists in the online user list, first previous connection information associated with the current user information may be obtained from the online user list, and then the previous connection information is compared with the currently received connection information sent by the gateway device, and if the previous connection information and the currently received connection information are consistent, it indicates that the current service request belongs to the same connection-sent request, that is, the current connection is the latest connection, and then the online user list does not need to be updated.
On the contrary, if the previous connection information is inconsistent with the currently received connection information sent by the gateway device, which indicates that the current service request and the previous service request of the same user information do not belong to the same connection (for example, a remote login occurs), at this time, the online user list needs to be updated. Wherein, an updating method can be as follows: and updating the prior connection information previously associated with the current user information in the online user list into the currently received connection information.
In an implementation manner, when it is determined that the previous connection information is not consistent with the connection information sent by the gateway device, this embodiment may further include the following steps:
and sending an offline operation notification to the gateway device, wherein the offline operation notification is used for notifying the gateway device to perform offline processing on the connection corresponding to the prior connection information.
In this embodiment, if the management service determines that the previous connection information is inconsistent with the currently received connection information sent by the gateway device, indicating that the management service detects that the same user information successively sends service requests on different connections, the management service may send an offline operation notification to the gateway device at this time to notify the gateway device to perform offline processing on the connection corresponding to the previous connection information, that is, to change the connection from online processing to offline processing, so as to realize the purpose of kicking off the previously logged-in user information.
For example, a certain communication account logs in at a terminal a, a client of the terminal a sends a service request to a gateway device, the gateway device sends the service request and connection information a to a management service, and the management service records an association relationship between user information and connection information a in an online user list. Subsequently, the communication account logs in at the terminal B, the client of the terminal B sends a service request to the gateway device, the gateway device sends the service request and the connection information B to the management service, the management service queries the user information in the online user list, finds that the user information is associated with the connection a in advance, and the management service can send an offline operation notification to the gateway device to notify the gateway device to change the login state corresponding to the connection a into a non-login state, to kick down the login of the connection a, and to change the connection a in the online user list into the connection B.
In other embodiments, the management service may also search the connection information in the online user list according to the connection information, and if the connection information is found, compare whether the previous user information corresponding to the connection information is consistent with the currently obtained user information, where a situation that the connection information is unchanged but the user information is changed may occur, for example, when a user logs out (logs out), the APP is actually connected to the server, and the connection information is unchanged, and if the user logs in another account at this time, the user information is changed, and at this time, the previous user information may be updated to the currently obtained user information, so as to update the user information.
In this embodiment, for a scenario in which user information exists in the online user list, if the management service determines that prior connection information previously associated with the current user information is inconsistent with currently received connection information sent by the gateway device, the management service replaces the prior connection information with the connection information sent by the gateway device, so as to implement real-time update of the online user list and ensure timeliness of recording of the latest user information.
Referring to fig. 4, a flowchart of a third step of a data processing method embodiment of the present application is shown, where this embodiment may be applied to a management service, and after step 304 or step 305 in fig. 3, this embodiment may further include the following steps:
step 306, receiving an offline notification message sent by the gateway device, where the offline notification message includes target connection information, and the offline notification message is a message generated when the gateway device detects that the connection with the client is disconnected.
Step 307, searching the target connection information in the online user list, and deleting the target connection information and the corresponding user information from the online user list.
In this embodiment, when the gateway device detects that the TCP long connection with the APP client is disconnected, the gateway device may send an offline notification message to the management service, and for example, the offline notification message may include target connection information and a preset disconnection flag indicating that the current message is an offline notification message.
After receiving the offline notification message, the management service may search the target connection information in the online user list, and delete the target connection information and the associated user information in the online user list when the target connection information is found, thereby implementing offline of the current user and ensuring real-time update of the online user list.
Referring to fig. 5, a flowchart of a fourth step of an embodiment of a method for data processing according to the embodiment of the present application is shown, where the embodiment may be applied to a management service, and after step 104 in fig. 1, the embodiment may further include the following steps:
step 105, receiving an online query request; and returning the online user list according to the online query request, or returning a query result corresponding to the online query request.
In this embodiment, the management service may also provide a query interface for online information. When an online query request is received via the query interface, the online query request may be parsed.
In one embodiment, if the online query request includes specific user information or connection information, the management service may query an online user list according to the specific user information or connection information, and if the specific user information or connection information is found, it indicates that the user information queried by the user is in an online state; otherwise, if the query result cannot be found, the user information queried by the user is in the offline state, and then the query result in the online state or the offline state is returned.
In another embodiment, if the online query request does not include specific user information or connection information, the management service may directly return an online user list for the user to perform data lookup according to the online user list.
The query function provided by the embodiment can expand the function of management service, and is convenient for a user to directly search related online information.
Referring to fig. 6, a flowchart of a fifth step of an embodiment of a method for data processing according to the embodiment of the present application is shown, where the embodiment may be applied to a management service, and after step 102 in fig. 1, the embodiment may further include the following steps:
step 106, sending a forwarding stopping notification to the gateway device, where the forwarding stopping notification is used to notify the gateway device to stop forwarding other service requests except for a preset service request of a specified type.
In this embodiment, after the management service parses the user information from the Session information, the management service may send a forwarding stop notification to the gateway device to notify the gateway device that all received service requests do not need to be forwarded (before the gateway device receives the forwarding stop notification, each received service request is forwarded to the management service), and only a preset service request of a specific type needs to be sent.
As an example, the preset specified type of service request may include, but is not limited to, the following service requests: user logout, re-login, APP shutdown, etc.
In this embodiment, the management service sends the forwarding stop notification to the gateway device to notify the gateway device that all received service requests do not need to be forwarded, but only a preset service request of a specified type needs to be sent. Thereby reducing the processing workload of the management service and saving the transmission resources between the gateway device and the management service.
Referring to fig. 7, a flowchart illustrating a sixth step of a data processing method embodiment according to an embodiment of the present application is shown, where the present embodiment may be applied to a gateway device, and may include the following steps:
step 701, receiving a service request sent by a client, where the service request includes Session information.
In one embodiment, a long connection, such as a TCP long connection, may be pre-established between the gateway device and the client and then communicated over the long connection.
The gateway device receives a service request sent by the client through the long connection, and in an example, the service request may include Session information, device information, and service data in a stateless interaction scenario or a stateful scenario in which a request protocol covers user information.
Step 702, generating connection information according to the service request.
In this step, after receiving the service request, the gateway device may generate connection information according to the long connection information and the service request, and the connection information may include, but is not limited to: a gateway identity and a connection identity. The gateway identifier is used for locating gateway information to which the current connection belongs, and may include, but is not limited to, an IP address of the gateway, a port number of the gateway, and the like; and the connection identifier is used to identify the current connection between the client and the gateway, and in one example, the connection identifier may be a connection ID, which is a hash value of (IP address of the client + port number of the client + IP address of the gateway + port number of the gateway).
And 703, copying the service request, and sending the copied service request and the connection information to a management service, where the management service is configured to analyze user information from the Session information and record the user information and the corresponding connection information in the generated online user list.
In this step, after receiving the service request, the gateway device copies the service request, and then sends the service request to the corresponding service according to the service type in the service request, and at the same time sends the copied service request and the connection information to the management service.
After receiving the service request, the service may perform corresponding service processing according to a preset service logic.
The management service may then process the service request and the connection information according to the method of the embodiment of fig. 1.
In an implementation manner, after step 703, this embodiment may further include the following steps:
when the disconnection with the client is detected, generating an offline notification message, wherein the offline notification message comprises target connection information; and sending the offline notification message to the management service, wherein the offline notification message is used for notifying the management service to delete the target connection information and the corresponding user information from the online user list.
In this embodiment, when detecting that the long connection with the client is disconnected, the gateway device sends an offline notification message to the management service, so that the management service deletes the target connection information and the corresponding user information in the online user list according to the target connection information carried in the offline notification message.
In an implementation manner, after step 703, this embodiment may further include the following steps:
receiving an offline operation notification sent by the management service, wherein the offline operation notification is a notification generated when the management service acquires previous connection information recorded in the online user list according to the user information and the received connection information are inconsistent; and performing offline processing on the connection corresponding to the prior connection information according to the offline operation notification.
In this embodiment, the gateway device may further receive an offline operation notification sent by the management service, so as to determine that two different pieces of connection information exist in the current user information, and then perform offline processing on the user information corresponding to the previous connection information.
In an implementation manner, after step 703, this embodiment may further include the following steps:
receiving a forwarding stop notification sent by the management service; and stopping forwarding other service requests except the preset service request of the specified type according to the forwarding stopping notification.
In this embodiment, the gateway device forwards all received service requests to the management service until a forwarding stop notification sent by the management service is received, and after the forwarding stop notification is received, the gateway device only sends the preset service request of the specified type to the management service, and other service requests are not sent, so that transmission resources of the gateway device and the management service are saved.
In other embodiments, the gateway device may also directly send all received service requests to the management service, which is not limited in this embodiment.
In this embodiment, after receiving a service request including Session information sent by a client, a gateway device may generate connection information according to the service request, copy one copy of the service request, and send the copied service request and connection information to a management service for online state management.
Based on the foregoing data processing method, referring to fig. 8, a block diagram of an embodiment of a data processing apparatus according to the present application is shown, where the embodiment may be applied to a management service, the management service is connected to a gateway device, and the apparatus may include the following modules:
an information receiving module 801, configured to receive a service request and connection information sent by a gateway device, where the service request includes Session information, and the service request is obtained by copying the service request after the gateway device receives the service request from a client;
a user information analyzing module 802, configured to analyze user information from the Session information;
an online determining module 803, configured to determine whether the user information is in the generated online user list; if not, the online recording module 804 is called;
an online recording module 804, configured to record the user information and the connection information in the online user list, where the user information is associated with the connection information in the online user list.
In one embodiment, the apparatus further comprises:
a previous connection information obtaining module, configured to obtain, if it is determined that the user information is in the generated online user list, previous connection information associated with the user information from the online user list;
the connection information judging module is used for judging whether the prior connection information is consistent with the connection information sent by the gateway equipment or not; if not, calling a connection information updating module;
and the connection information updating module is used for replacing the prior connection information with the connection information sent by the gateway equipment.
In one embodiment, the apparatus further comprises:
and the offline operation notification sending module is used for sending an offline operation notification to the gateway device if the prior connection information is judged to be inconsistent with the connection information sent by the gateway device, wherein the offline operation notification is used for notifying the gateway device to perform offline processing on the connection corresponding to the prior connection information.
In one embodiment, the apparatus further comprises:
an offline notification message receiving module, configured to receive an offline notification message sent by the gateway device, where the offline notification message includes target connection information, and the offline notification message is a message generated when the gateway device detects that the connection with the client is disconnected;
and the online record deleting module is used for searching the target connection information in the online user list and deleting the target connection information and the corresponding user information from the online user list.
In one embodiment, the apparatus further comprises:
and the transmission stopping notification sending module is used for sending a transmission stopping notification to the gateway equipment after the user information is analyzed from the Session information, wherein the transmission stopping notification is used for notifying the gateway equipment to stop transmitting other service requests except the preset service request of the specified type.
In one embodiment, the apparatus further comprises:
the query module is used for receiving an online query request; and returning the online user list according to the online query request, or returning a query result corresponding to the online query request.
Referring to fig. 9, a block diagram of another embodiment of a data processing apparatus according to the present application is shown, where this embodiment may be applied to a gateway device, and the apparatus may include the following modules:
a service request receiving module 901, configured to receive a service request sent by a client, where the service request includes Session information;
a connection information generating module 902, configured to generate connection information according to the service request;
an information sending module 903, configured to copy the service request, and send the copied service request and the connection information to a management service, where the management service is configured to parse user information from the Session information and record the user information and the corresponding connection information in a generated online user list.
In one embodiment, the apparatus further comprises:
the offline notification module is used for generating an offline notification message when the disconnection of the client is detected, wherein the offline notification message comprises target connection information; and sending the offline notification message to the management service, wherein the offline notification message is used for notifying the management service to delete the target connection information and the corresponding user information from the online user list.
In one embodiment, the apparatus further comprises:
and the service request sending module is used for sending the service request to a service, and the service performs corresponding service processing according to a preset service logic.
In one embodiment, the apparatus further comprises:
the offline processing module is used for receiving an offline operation notification sent by the management service after the copied service request and the connection information are sent to the management service, wherein the offline operation notification is a notification generated when the management service acquires the previous connection information recorded in the online user list according to the user information and the received connection information are inconsistent; and performing offline processing on the connection corresponding to the prior connection information according to the offline operation notification.
In one embodiment, the apparatus further comprises:
a stop forwarding module, configured to receive a stop forwarding notification sent by a management service after the service request obtained by copying and the connection information are sent to the management service; and stopping forwarding other service requests except the preset service request of the specified type according to the forwarding stopping notification.
The embodiment of the application also discloses an electronic device, which comprises:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method embodiments described above.
The embodiment of the application also discloses a storage medium, and when instructions in the storage medium are executed by a processor of the device, the electronic device can be enabled to execute the method embodiment.
With regard to the apparatus, the electronic device, and the storage medium in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method, and will not be described in detail here.
While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or of what may be claimed, but rather as descriptions of features specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. In other instances, features described in connection with one embodiment may be implemented as discrete components or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.
Similarly, while operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
Thus, particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. Further, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some implementations, multitasking and parallel processing may be advantageous.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (10)

1. A method for data processing, applied to a management service, wherein the management service is connected to a gateway device, the method comprising:
receiving a service request and connection information sent by gateway equipment, wherein the service request comprises Session information, and the service request is obtained by copying the service request after the gateway equipment receives the service request from a client;
analyzing user information from the Session information;
judging whether the user information is in a generated online user list or not;
if not, recording the user information and the connection information in the online user list, wherein the user information is associated with the connection information in the online user list.
2. The method of claim 1, further comprising:
if the user information is judged to be in the generated online user list, acquiring prior connection information associated with the user information from the online user list;
judging whether the prior connection information is consistent with the connection information sent by the gateway equipment or not;
and if the connection information is inconsistent with the previous connection information, replacing the previous connection information with the connection information sent by the gateway equipment.
3. The method of claim 2, wherein if it is determined that the prior connection information is inconsistent with the connection information sent by the gateway device, the method further comprises:
and sending an offline operation notification to the gateway device, wherein the offline operation notification is used for notifying the gateway device to perform offline processing on the connection corresponding to the prior connection information.
4. The method according to any one of claims 1-3, further comprising:
receiving an offline notification message sent by the gateway device, wherein the offline notification message comprises target connection information, and the offline notification message is generated when the gateway device detects that the connection with the client is disconnected;
and searching the target connection information in the online user list, and deleting the target connection information and the corresponding user information from the online user list.
5. The method according to any one of claims 1-3, further comprising:
and after analyzing the user information from the Session information, sending a forwarding stopping notification to the gateway equipment, wherein the forwarding stopping notification is used for notifying the gateway equipment to stop forwarding other service requests except the preset service request of the specified type.
6. A data processing method is applied to a gateway device, and the method comprises the following steps:
receiving a service request sent by a client, wherein the service request comprises Session information;
generating connection information according to the service request;
and copying the service request, and sending the copied service request and the connection information to a management service, wherein the management service is used for analyzing user information from the Session information and recording the user information and the corresponding connection information in a generated online user list.
7. An apparatus for data processing, wherein the apparatus is applied to a management service, and the management service is connected to a gateway device, the apparatus comprising:
the system comprises an information receiving module, a service request processing module and a service request processing module, wherein the information receiving module is used for receiving a service request and connection information sent by gateway equipment, the service request comprises Session information, and the service request is obtained by copying the service request after the gateway equipment receives the service request from a client;
the user information analysis module is used for analyzing the user information from the Session information;
the online judging module is used for judging whether the user information is in the generated online user list or not; if not, calling an online recording module;
and the online recording module is used for recording the user information and the connection information in the online user list, and the user information and the connection information are associated in the online user list.
8. An apparatus for data processing, applied to a gateway device, the apparatus comprising:
the service request receiving module is used for receiving a service request sent by a client, wherein the service request comprises Session information;
the connection information generating module is used for generating connection information according to the service request;
and the information sending module is used for copying the service request, sending the copied service request and the connection information to a management service, and the management service is used for analyzing the user information from the Session information and recording the user information and the corresponding connection information in the generated online user list.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of any of claims 1-5 and/or 6.
10. A storage medium having instructions that, when executed by a processor of the device, enable the electronic device to perform the method of any of claims 1-5 and/or 6.
CN201911124034.0A 2019-11-17 2019-11-17 Data processing method and device Active CN110855785B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911124034.0A CN110855785B (en) 2019-11-17 2019-11-17 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911124034.0A CN110855785B (en) 2019-11-17 2019-11-17 Data processing method and device

Publications (2)

Publication Number Publication Date
CN110855785A true CN110855785A (en) 2020-02-28
CN110855785B CN110855785B (en) 2022-08-09

Family

ID=69600343

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911124034.0A Active CN110855785B (en) 2019-11-17 2019-11-17 Data processing method and device

Country Status (1)

Country Link
CN (1) CN110855785B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1976325A (en) * 2006-12-13 2007-06-06 Ut斯达康通讯有限公司 Network system capable of realizing immediate message communication and communicating method
CN101075886A (en) * 2007-06-29 2007-11-21 中国移动通信集团公司 Method and device for distributed charging content
CN101808048A (en) * 2010-03-10 2010-08-18 杭州乐港科技有限公司 Web instant messaging method
CN102149218A (en) * 2010-06-23 2011-08-10 华为技术有限公司 Method for user information query as well as user information center and gateway device
CN102843391A (en) * 2011-06-21 2012-12-26 中兴通讯股份有限公司 Information transmitting method and gateway
CN105813152A (en) * 2014-12-30 2016-07-27 中国电信股份有限公司 Network handover method and system and communication equipment
CN106851634A (en) * 2017-03-07 2017-06-13 西安新路网络科技有限公司 A kind of method that equipment on-line state is managed under Portal environment
WO2017114266A1 (en) * 2015-12-31 2017-07-06 华为技术有限公司 Data service charging method, device and system
CN107580046A (en) * 2017-08-31 2018-01-12 北京奇虎科技有限公司 Long connection service system and method
US20190273764A1 (en) * 2018-03-02 2019-09-05 Murata Machinery, Ltd. Relay server

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1976325A (en) * 2006-12-13 2007-06-06 Ut斯达康通讯有限公司 Network system capable of realizing immediate message communication and communicating method
CN101075886A (en) * 2007-06-29 2007-11-21 中国移动通信集团公司 Method and device for distributed charging content
CN101808048A (en) * 2010-03-10 2010-08-18 杭州乐港科技有限公司 Web instant messaging method
CN102149218A (en) * 2010-06-23 2011-08-10 华为技术有限公司 Method for user information query as well as user information center and gateway device
CN102843391A (en) * 2011-06-21 2012-12-26 中兴通讯股份有限公司 Information transmitting method and gateway
CN105813152A (en) * 2014-12-30 2016-07-27 中国电信股份有限公司 Network handover method and system and communication equipment
WO2017114266A1 (en) * 2015-12-31 2017-07-06 华为技术有限公司 Data service charging method, device and system
CN106851634A (en) * 2017-03-07 2017-06-13 西安新路网络科技有限公司 A kind of method that equipment on-line state is managed under Portal environment
CN107580046A (en) * 2017-08-31 2018-01-12 北京奇虎科技有限公司 Long connection service system and method
US20190273764A1 (en) * 2018-03-02 2019-09-05 Murata Machinery, Ltd. Relay server

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
MARYAM AMIRI: "《Game-Aware Resource Manager for Home Gateways》", 《IEEE》 *
周渝霞: "互联网业务自动开通系统程序设计的研究", 《科技资讯》 *

Also Published As

Publication number Publication date
CN110855785B (en) 2022-08-09

Similar Documents

Publication Publication Date Title
WO2021121370A1 (en) Message loss detection method and apparatus for message queue
US20180359140A1 (en) Method, device, and system for processing a terminal fault
US10313452B2 (en) Migrating a chat message service provided by a chat server to a new chat server
CN108712485B (en) Resource subscription method and device for Internet of things equipment
CN108063714B (en) Network request processing method and device
CN108881354B (en) Push information storage method and device, server and computer storage medium
WO2021232197A1 (en) Method and apparatus for monitoring device state, device, and storage medium
US10263937B2 (en) Automated message recall from a sender's device
JP2018508072A (en) Method and apparatus for pushing messages
CN111711533B (en) Fault diagnosis method, fault diagnosis device, electronic device and storage medium
CN109039724B (en) Log uploading method and device
CN112788126A (en) Resource downloading method, device, server and storage medium
CN111679916B (en) Video recommendation method, target service providing terminal, service calling terminal and system
CN111008254A (en) Object creating method and device, computer equipment and storage medium
CN113315689B (en) Information processing method, system, electronic device and readable storage medium
CN111064729B (en) Message processing method and device, storage medium and electronic device
CN110855785B (en) Data processing method and device
CN111930542A (en) Data acquisition method and device, electronic equipment and computer readable storage medium
CN114338794B (en) Service message pushing method and device, electronic equipment and storage medium
CN105721885B (en) Method, device and system for processing transcoding data
CN115632815A (en) Data updating method and device, electronic equipment and storage medium
CN111880949B (en) Service information processing method, system, device, server and terminal
CN115883639A (en) Web real-time message pushing method and device, equipment and storage medium
JP2009540402A (en) Method, system and device for reporting user agent profile information
CN109688204B (en) File downloading method, node and terminal based on NDN (named data networking)

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant