CN110602171A - Interaction method and device - Google Patents

Interaction method and device Download PDF

Info

Publication number
CN110602171A
CN110602171A CN201910768737.0A CN201910768737A CN110602171A CN 110602171 A CN110602171 A CN 110602171A CN 201910768737 A CN201910768737 A CN 201910768737A CN 110602171 A CN110602171 A CN 110602171A
Authority
CN
China
Prior art keywords
scene
field value
terminal
link identifier
link
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
CN201910768737.0A
Other languages
Chinese (zh)
Other versions
CN110602171B (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.)
Wangsu Science and Technology Co Ltd
Original Assignee
Wangsu Science and 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 Wangsu Science and Technology Co Ltd filed Critical Wangsu Science and Technology Co Ltd
Priority to CN201910768737.0A priority Critical patent/CN110602171B/en
Publication of CN110602171A publication Critical patent/CN110602171A/en
Application granted granted Critical
Publication of CN110602171B publication Critical patent/CN110602171B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • 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/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention provides an interaction method and an interaction device, wherein the method comprises the following steps: establishing long connection with a server; determining the type of the current service scene; acquiring a scene field value according to the determined type; and generating a link identifier by using the scene field value, and marking the network request by using the link identifier when sending the network request to the server in the current service scene operation process, so that the server responds to the network request to obtain a request result and then feeds back the request result to the terminal based on the link identifier. By applying the scheme provided by the embodiment of the invention, the link identifier is used for marking the network requests in the process from the beginning to the end of the current service scene, one link identifier is generated aiming at the whole service scene, and the marking of all the network requests in the whole service scene is realized by using one link identifier, so that the frequency of generating the link identifier by the terminal is reduced, correspondingly, the frequency of identifying the link identifier by the server side is also reduced, and the computing resources of an internet system are reduced.

Description

Interaction method and device
Technical Field
The invention relates to the technical field of computer application, in particular to an interaction method and device.
Background
In order to prevent a network request from being lost during network transmission in the process of long-connection interaction between a terminal and a server in an internet system, the terminal usually marks a primary network request by using a link identifier (trace _ id) used for tracking the network request from the terminal to the server. For the same network request, the link identifier of the network request is invariable among different service terminals, and the invariable link identifier can be used for inquiring, searching and recording the operation condition of the network request among different service terminals.
However, in a long connection process, a link identifier is generated for each network request terminal, and accordingly, the server needs to identify the link identifier in each network request, which results in increased consumption of computing resources of the internet system. Meanwhile, different link identifications improve the troubleshooting difficulty in the problem troubleshooting process, and the troubleshooting time and labor consumption are increased.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide an interaction method and apparatus. The technical scheme is as follows:
in a first aspect, an interaction method is provided, which is applied to a terminal, and the method includes:
establishing long connection with a server;
determining the type of a current service scene, wherein the current service scene is a scene for performing data interaction with the server based on the long connection;
acquiring a scene field value according to the determined type;
and generating a link identifier by using the scene field value, and when a network request is sent to the server in the operation process of the current service scene, marking the network request by using the link identifier so that the server responds to the network request to obtain a request result, and then feeding back the request result to the terminal based on the link identifier.
In a long connection process, a link identifier is generated for one service scene, so that all network requests in the whole service scene are marked by using one link identifier, the generation times of the link identifier are reduced, and the computing resources of the terminal can be reduced. And the link identification is unified, so that the problem occurrence range can be determined according to the same identification when the problem is checked, the log searching speed is accelerated, and the checking time consumption and the manpower consumption are reduced.
Optionally, the step of determining the type to which the current service scenario belongs includes:
determining a module for realizing the current service scene function;
and determining the type of the current service scene according to the function realized by the module.
Different service scenes have different modules for realizing the functions, and the type of the current service scene can be quickly determined through the functions of the modules.
Optionally, before the step of generating a link identifier using the scene field value, the method further includes:
acquiring a function field value according to the function realized by the module;
correspondingly, the step of generating a link identifier by using the scene field value includes:
and generating a link identification by using the scene field value and the function field value.
The function field value is determined by the function of each module, and the link identification can be refined by the function field value.
Optionally, before the step of generating the link identifier according to the scene field value and the function field value, the method further includes:
acquiring identification information of a user operating in the current service scene;
correspondingly, the step of generating a link identifier according to the scene field value and the function field value includes:
and generating a link identifier according to the scene field value, the function field value and the identifier information.
There may be a plurality of users operating in the same service scenario, and therefore, the link identification may be refined by using the identification information of each user to distinguish each user.
Optionally, before the step of generating the link identifier according to the scene field value and the function field value, the method further includes:
acquiring historical times of link identification generated aiming at the current service scene;
correspondingly, the step of generating a link identifier according to the scene field value and the function field value includes:
and generating a link identifier according to the scene field value, the function field value and the historical times.
The service scenario generates a link identifier at each runtime, and in order to distinguish the link identifiers generated at each runtime of the service scenario, the link identifiers may be refined by using the historical times of generating the link identifiers.
Optionally, before the step of generating the link identifier according to the scene field value, the function field value, and the identifier information, the method further includes:
acquiring historical times of link identification generated aiming at the current service scene;
correspondingly, the step of generating a link identifier according to the scene field value, the function field value and the identifier information includes:
and generating a link identifier according to the scene field value, the function field value, the identification information and the historical times.
Because only one link identifier is generated for one service scene, correspondingly, the server side can use one link identifier to mark all the operation logs, and thus when a user needs to check the operation logs of the service scene through the terminal, all the operation logs in the process of one service scene can be quickly searched out by using the link identifiers.
Optionally, the method further includes:
sending an operation log search request carrying the link identifier to the server, so that the server searches an operation log according to the link identifier and feeds the operation log back to the terminal, wherein the operation log is a log for performing data interaction between the terminal and the server based on the current service scene in the long connection process;
and receiving and displaying the operation log.
In a second aspect, an interaction method is provided, which is applied to a server, and the method includes:
establishing long connection with a terminal;
receiving a network request which is sent by the terminal and carries a link identifier, wherein the link identifier is an identifier which is generated by the terminal according to the type of a current service scene and is used for marking the network request in the operation process of the current service scene, and the current service scene is a scene which is used for carrying out data interaction between the terminal and the service terminal based on the long connection;
responding the network request to obtain a request result;
and feeding back the request result to the terminal based on the link identification.
Optionally, the step of obtaining a request result in response to the network request includes:
storing the link identification and distributing the link identification to a component used for responding to the network request in the server;
recording interaction information between the components for responding to the network request based on the link identification;
and obtaining the request result based on the interaction information.
Optionally, the method further includes:
receiving an operation log search request which is sent by the terminal and carries the link identification, wherein the operation log is a log for performing data interaction between the terminal and the server based on the current service scene in the long connection process;
searching the operation log based on the link identification;
and feeding back the operation log to the terminal so that the terminal displays the operation log.
In a third aspect, an interactive apparatus is provided, which is applied to a terminal, and includes:
the first establishing module is used for establishing long connection with the server;
the determining module is used for determining the type of a current service scene, wherein the current service scene is a scene for performing data interaction with the server based on the long connection;
the obtaining module is used for obtaining the scene field value according to the determined type;
and the sending module is used for generating a link identifier by using the scene field value, and marking the network request by using the link identifier when sending the network request to the server in the running process of the current service scene so that the server responds to the network request to obtain a request result, and then feeds back the request result to the terminal based on the link identifier.
Optionally, the determining module is further configured to
Determining a module for realizing the current service scene function;
and determining the type of the current service scene according to the function realized by the module.
Optionally, the obtaining module is further configured to obtain a function field value according to a function implemented by the module;
correspondingly, the sending module is further configured to generate a link identifier by using the scene field value and the function field value.
Optionally, the obtaining module is further configured to obtain identification information of a user operating in the current service scenario;
correspondingly, the sending module is further configured to generate a link identifier according to the scene field value, the function field value, and the identifier information.
Optionally, the obtaining module is further configured to obtain a historical number of link identifiers generated for the current service scenario;
correspondingly, the sending module is further configured to generate a link identifier according to the scene field value, the function field value, and the history times.
Optionally, the obtaining module is further configured to obtain a historical number of link identifiers generated for the current service scenario;
correspondingly, the sending module is further configured to generate a link identifier according to the scene field value, the function field value, the identifier information, and the history times.
Optionally, the apparatus further comprises:
the display module is used for sending an operation log search request carrying the link identifier to the server, so that the server searches an operation log according to the link identifier and feeds the operation log back to the terminal, wherein the operation log is a log for performing data interaction between the terminal and the server based on the current service scene in the long connection process;
and receiving and displaying the operation log.
In a fourth aspect, an interaction apparatus is further provided, which is applied to a server and includes:
the second establishing module is used for establishing long connection with the terminal;
a receiving module, configured to receive a network request carrying a link identifier sent by the terminal, where the link identifier is an identifier that is generated by the terminal according to a type to which a current service scenario belongs and used for marking a network request in an operation process of the current service scenario, and the current service scenario is a scenario used for data interaction between the terminal and the server based on the long connection;
the response module is used for responding the network request to obtain a request result;
and the feedback module is used for feeding back the request result to the terminal based on the link identification.
Optionally, the response module is further configured to store the link identifier, and allocate the link identifier to a component in the server, which is used for responding to the network request;
recording interaction information between the components for responding to the network request based on the link identification;
and obtaining the request result based on the interaction information.
Optionally, the apparatus further comprises: a searching module, configured to receive an operation log search request carrying the link identifier and sent by the terminal, where the operation log is a log of data interaction between the terminal and the server based on the current service scenario in the long connection process;
searching the operation log based on the link identification;
and feeding back the operation log to the terminal so that the terminal displays the operation log.
The embodiment of the invention provides an interaction method and device, which can determine a scene field value according to the type of a current service scene; determining a function field value by using a mode for realizing the current service scene function; and generating a link identifier according to the scene field value and the function field value. The generated link identifier is used for marking the network requests in the current service scene in the process from the beginning to the end of the current service scene, namely, the method provided by the embodiment of the invention is applied, the link identifier is generated aiming at the whole service scene, and the marking of all the network requests in the whole service scene is realized by utilizing the link identifier, so that the generation times of the link identifier of the terminal is reduced, correspondingly, the times of identifying the link identifier by the service end is reduced, and the computing resources of an internet system can be reduced. Meanwhile, the link identifiers are unified, so that the problem occurrence range can be determined according to the same identifier when the problems are checked, the log searching speed is increased, and the checking time consumption and the manpower consumption are reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of an interaction scenario provided by an embodiment of the present invention
Fig. 2 is a schematic flowchart of an interaction method according to an embodiment of the present invention;
FIG. 3 is a flow chart of another interaction method provided by the embodiment of the invention;
FIG. 4 is a schematic structural diagram of an interaction apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of another interactive apparatus provided in the embodiment of the present invention;
fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The embodiment of the invention provides an interaction method, which is applied to a system framework shown in fig. 1, wherein the system framework comprises: when the system framework is applied to an audio and video live broadcast service scene, an application program for providing audio and video live broadcast service can be installed in the terminal, and each component for scheduling, room management, signaling and streaming media data management can be contained in the server.
In implementation, when the push flow starts, each terminal establishes long connection with a server, then determines the type of the current service scene according to the functions of each module in an application program, and acquires the field value of the scene according to the determined type; acquiring a function field value according to the function realized by each module; acquiring identification information of a user operating in a current service scene; acquiring historical times of link identification generated aiming at a current service scene; and generating a new link identifier (trace _ id) according to the scene field value, the function field value, the identifier information and the history times. The link identification runs through the whole flow pushing process, and the link identification cannot be changed no matter what happens in the flow pushing process, such as network disconnection and reconnection.
After the terminal generates the link identifier, the network request is marked by the link identifier and is sent to the server, and after the server receives the network request, the link identifier is extracted and is sent to each component for realizing scheduling, room management, signaling and streaming media data management; the server can record the data interaction process among the components by using the link identifiers to obtain a request result and feed the request result back to the terminal in the data interaction process with each terminal, and can record the operation logs interacted between the server and each terminal by using the link identifiers respectively so as to facilitate each terminal to search the operation logs.
Fig. 2 is a flowchart of an interaction method provided in an embodiment of the present invention, which is applied to a terminal, and the method may include:
and step 200, establishing long connection with the server.
In implementation, when audio and video stream transmission is performed between a client and a server, each audio and video stream usually contains multiple network requests, so that the audio and video stream transmission between the client and the server is usually completed based on one long connection.
Step 210, determining the type of the current service scenario.
The current service scenario is a scenario in which data interaction is performed with the server based on the long connection. Specifically, the service scene may be of different types, such as a service scene for live audio/video broadcasting, a service scene for real-time chat, and the like.
In implementation, each service scene may include a plurality of sub-scenes, for example, a service scene for audio/video live broadcast may include sub-scenes such as a microphone, a video conference, and the like; the service scene for real-time chat may include sub-scenes of multi-group chat, single chat, and the like. Based on this, when determining the type of the current service scenario, the determination may be performed based on the function of the service scenario, or may be performed based on the function of a sub-scenario in the service scenario.
In the implementation, the implementation of the service scene function is usually completed by one or more modules having corresponding functions, and the modules implement the corresponding service scene function by executing code steps defined by themselves, for example, in an audio/video live broadcast service scene, the audio/video live broadcast service is usually implemented by a module for pushing/pulling audio/video data, a module for connecting microphones between different users, and the like. Therefore, in one implementation, when determining the type of the current service scenario, the function of the current service scenario may be determined according to the function of the module for implementing the function of the current service scenario. For example, when the module for implementing the function of the current service scene is a module for pushing/pulling the audio/video data and a module for connecting the different users, it may be determined that the current service scene is an audio/video live broadcast service scene.
And step 220, acquiring a scene field value according to the determined type.
In implementation, a scene field value corresponding to each type may be preset, for example, a service scene of live audio and video is taken as an example, common sub-scenes include a microphone connecting and a video conference, and correspondingly, link/meeting may be used as the scene field values corresponding to the microphone connecting and the video conference respectively. Based on this, after determining the type of the current service scene, the scene field value is also obtained.
Step 230, generating a link identifier by using the scene field value, and when sending a network request to the server in the current service scene operation process, marking the network request by using the link identifier, so that the server responds to the network request to obtain a request result, and then feeding back the request result to the terminal based on the link identifier.
The current service scene running process refers to a process from the beginning to the end of the current service scene.
In an implementation, after the scene field value used to construct the link identifier is obtained, the scene field value may be used to generate the link identifier. For example, in a service scene of audio/video live broadcast, a scene field value is meeting, and correspondingly, a link identifier may be referred to as meeting.
After the link identifier is generated, the network request can be marked by using the link identifier in the running process of each current service scene, and correspondingly, after the server receives the network request, the link identifier can be stored and distributed to each component used for responding to the network request in the server; therefore, the link identification is used for recording the mutual information between the components for responding to the network request so as to obtain a request result; and finally, feeding back the request result to the terminal according to the link identification.
By applying the scheme provided by the embodiment of the invention, the life cycle of the link identifier is not the same as that of a single network request any more, but is extended to the beginning to the end of the whole service scene, namely, a link identifier is generated aiming at the whole service scene, and all network requests in the whole service scene are marked by utilizing one link identifier, so that the generation times of the link identifier are reduced, and the computing resources of the terminal are reduced.
In an implementation, to refine the link identification, an operation part field value of the link identification may be generated according to respective functions of the module for implementing the current traffic scenario function.
Specifically, a mapping relationship between the function and the function field value of each module may be preset, for example, in a service scene of live audio and video, the function field value corresponding to the module for pushing stream of audio and video data is push, and the function field value corresponding to the module for pulling stream of audio and video data is pull.
After the function field value is determined, the scene field value and the function field value may be used to generate a link identifier, for example, the scene field value is recording, the function field value is push, and accordingly, the link identifier may be denoted as recording _ push.
In implementation, in order to distinguish users operating in the same service scenario, identification information of the users may also be obtained, and a link identification is generated by using a scenario field value, a function field value, and the identification information of the users of the current service scenario.
The identification information of the user may include: identity information of the user, account information used by the user, terminal model information used by the user, and the like. For example, the identification information of the user may be formed by using a client _ host _ channel id _ userId _ UUID field, where each field may be adjusted according to actual needs, and taking the client as an example, for terminals such as Android/iOS/Window/H5/Mac, corresponding english names may be respectively filled in, and may also be abbreviated as a/I/W/H/M.
In the field of the link identifier, the Host, the channeldId and the userId can be changed according to different service scenes, and a domain name, a channel number and a user account can be used as the identifier of the user by taking the service scene of audio and video live broadcast as an example; for the scenes of chatting software and the like, the client account number, the nickname and the like can be used for replacing the scenes.
In the field of the link identifier, the UUID part may correspond to a device identifier of the terminal, and may be globally unique, for example, an International Mobile Equipment Identity (IMEI) of the terminal may be used as the device identifier of the terminal. In implementation, for a service scene of web browsing, in order to avoid using the same device identifier for a large number of web pages, random numbers can be used for replacement; it may be replaced by a device ID + random number.
In implementation, a link identifier is generated in each operation of the same service scenario, in order to distinguish the link identifiers generated in each initial operation of the same service scenario, the historical times of the link identifiers generated for the current service scenario may be obtained, and the link identifiers are generated by using the scene field value, the function field value and the historical times of the current service scenario. Since the history times are a global self-increasing value, that is, the link identifier is automatically increased by 1 every time the link identifier is generated, the field value of the history times is increased in the link identifier, and the link identifiers generated at each start for the same service scene can be distinguished.
In implementation, in order to simultaneously distinguish different users operating in the same service scenario from different users operating in the same service scenario, the link identifier may be generated using a scenario field value, a function field value, identification information, and a history number of a current service scenario. At this time, the link identifier not only can identify the network request, but also includes user information, service scenario information and historical frequency information, thereby facilitating quick troubleshooting and locating the service scenario corresponding to the link identifier.
In implementation, because a link identifier is used to mark an operation process of data interaction with a server every time in an operation process from beginning to end of the same service scene, when an operation log of the service scene is produced, each operation record can carry the link identifier, the server can also record the production operation log of each operation process, and the link identifier is used to mark the operation log, so that when a terminal needs to query the operation log, an operation log search request carrying the link identifier can be sent to the server; correspondingly, the server side can search the operation log according to the link identification, and feed the searched operation log back to the terminal, and the terminal can display the operation log after receiving the operation log.
The operation logs recording all operation events in the same service scene can be quickly obtained through one link identifier, and further, the operation logs are filtered, so that the reason of the problem of the current user can be quickly positioned, other operation behaviors of the user can be quickly confirmed, whether the fed-back user problem is a real problem or not can be confirmed, and whether other suspicious operations possibly causing the problem exist or not can be quickly positioned. The problem troubleshooting time of a real-time audio and video system can be greatly reduced, and the user feedback problem can be confirmed in minute-level time.
In implementation, the log can be displayed through Portal, the display form can be divided into two types, one type is that time is used as an axis, the sequence of different operation events is displayed, and the operation sequence and the network request sequence of a client are confirmed. The other type shows the condition of the quality change of the flow state by taking time as an X axis and the change of key data as a Y axis.
Fig. 3 is another interaction method provided in the embodiment of the present invention, which is applied to a server, and the method includes:
step 300, establishing long connection with a terminal;
in implementation, when audio and video stream transmission is performed between a client and a server, each audio and video stream usually contains multiple network requests, so that the audio and video stream transmission between the client and the server is usually completed based on one long connection.
Step 310, receiving a network request carrying a link identifier sent by a terminal.
The link identifier is an identifier which is generated by the terminal according to the type of the current service scene and is used for marking the network request in the operation process of the current service scene, and the current service scene is a scene which is used for data interaction between the terminal and the server based on long connection.
Step 320, obtaining the request result in response to the network request.
In an implementation manner, after receiving a network request carrying a link identifier sent by a terminal, a server may extract the link identifier for storage, and allocate the link identifier to each component used for responding to the network request in the server, that is, components used for implementing the same function are assigned with the same link identifier, so that in the process of performing information interaction by using the link identifier between the components, the server may record interaction information used for responding to the network request between the components based on the link identifier, and finally obtain a request result.
Step 330, sending the request result to the terminal based on the link identification.
In an implementation, after obtaining the request result, the terminal sending the network request may be determined by using the link identifier, and the request result may be sent to the terminal.
Based on this, the life cycle of the link identifier is no longer the same as that of a single network request, but extends from the beginning to the end of the whole service scene, that is, a link identifier is generated for the whole service scene, and the server can identify the network request sent by the terminal in the running process of the whole service scene by using one link identifier, thereby reducing the calculation resource loss of the server.
In implementation, the server may record an operation log for performing data interaction with the terminal in a current service scenario, and mark the operation log by using the link identifier, so that when the server receives an operation log search request carrying the link identifier sent by the terminal, the operation log in the whole service scenario may be searched according to the link identifier, and the operation log is fed back to the terminal, so that the terminal displays the operation log.
The link identifiers are unified, so that the problem occurrence range can be determined according to the same identifier when the problems are checked, the log searching speed is increased, and the checking time consumption and the manpower consumption are reduced.
Based on the same technical concept, an embodiment of the present invention further provides an interaction apparatus, as shown in fig. 4, applied to a terminal, the apparatus including:
a first establishing module 400, configured to establish a long connection with a server;
a determining module 410, configured to determine a type to which a current service scenario belongs, where the current service scenario is a scenario in which data interaction is performed with the server based on the long connection;
an obtaining module 420, configured to obtain a scene field value according to the determined type;
a sending module 430, configured to generate a link identifier by using the scene field value, and when sending a network request to the server in the operation process of the current service scene, mark the network request by using the link identifier, so that after the server responds to the network request and obtains a request result, the request result is fed back to the terminal based on the link identifier.
Optionally, the determining module 410 is further configured to
Determining a module for realizing the current service scene function;
and determining the type of the current service scene according to the function realized by the module.
Optionally, the obtaining module 420 is further configured to obtain a function field value according to a function implemented by the module;
correspondingly, the sending module 430 is further configured to generate a link identifier by using the scene field value and the function field value.
Optionally, the obtaining module 420 is further configured to obtain identification information of a user performing an operation in the current service scenario;
correspondingly, the sending module 430 is further configured to generate a link identifier according to the scene field value, the function field value, and the identifier information.
Optionally, the obtaining module 420 is further configured to obtain a historical number of link identifiers generated for the current service scenario;
correspondingly, the sending module 430 is further configured to generate a link identifier according to the scene field value, the function field value, and the history times.
Optionally, the obtaining module 420 is further configured to obtain a historical number of link identifiers generated for the current service scenario;
correspondingly, the sending module 430 is further configured to generate a link identifier according to the scene field value, the function field value, the identifier information, and the history times.
Optionally, the apparatus further comprises:
the display module is used for sending an operation log search request carrying the link identifier to the server, so that the server searches an operation log according to the link identifier and feeds the operation log back to the terminal, wherein the operation log is a log for performing data interaction between the terminal and the server based on the current service scene in the long connection process;
and receiving and displaying the operation log.
By applying the scheme provided by the embodiment of the invention, the life cycle of the link identifier is not the same as that of a single network request any more, but is extended to the beginning to the end of the whole service scene, namely, a link identifier is generated aiming at the whole service scene, and all network requests in the whole service scene are marked by utilizing one link identifier, so that the generation times of the link identifier are reduced, and the computing resources of the terminal are reduced. In addition, the link identifier can identify the network request, and the link identifier also contains user information, service scene information and historical frequency information, so that problems can be conveniently and quickly checked, and the service scene corresponding to the link identifier can be positioned.
Based on the same technical concept, an embodiment of the present invention further provides an interaction apparatus, as shown in fig. 5, applied to a server, where the apparatus includes:
a second establishing module 500, configured to establish a long connection with a terminal;
a receiving module 510, configured to receive a network request carrying a link identifier sent by the terminal, where the link identifier is an identifier that is generated by the terminal according to a type to which a current service scenario belongs and used for marking a network request in an operation process of the current service scenario, and the current service scenario is a scenario used for data interaction between the terminal and the server based on the long connection;
a response module 520, configured to respond to the network request to obtain a request result;
a feedback module 530, configured to feed back the request result to the terminal based on the link identifier.
Optionally, the response module 520 is further configured to store the link identifier, and allocate the link identifier to a component in the server for responding to the network request;
recording interaction information between the components for responding to the network request based on the link identification;
and obtaining the request result based on the interaction information.
Optionally, the apparatus further comprises: a searching module, configured to receive an operation log search request carrying the link identifier and sent by the terminal, where the operation log is a log of data interaction between the terminal and the server based on the current service scenario in the long connection process;
searching the operation log based on the link identification;
and feeding back the operation log to the terminal so that the terminal displays the operation log.
By applying the scheme provided by the embodiment of the invention, the life cycle of the link identifier is not the same as that of a single network request any more, but is extended to the beginning to the end of the whole service scene, namely, a link identifier is generated aiming at the whole service scene, and the server can identify the network request sent by the terminal in the operation process of the whole service scene by utilizing one link identifier, so that the calculation resource loss of the server is reduced.
Fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present invention. The computer device 600, which may vary widely in configuration or performance, may include one or more central processors 622 (e.g., one or more processors) and memory 632, one or more storage media 630 (e.g., one or more mass storage devices) that store applications 642 or data 644. Memory 632 and storage medium 630 may be, among other things, transient or persistent storage. The program stored in the storage medium 630 may include one or more modules (not shown), each of which may include a sequence of instructions for operating on the computer device 600. Still further, the central processor 622 may be configured to communicate with the storage medium 630 to execute a series of instruction operations in the storage medium 630 on the computer device 600.
The computer apparatus 600 may also include one or more power supplies 624, one or more wired or wireless network interfaces 650, one or more input-output interfaces 658, one or more keyboards 654, and/or one or more operating systems 641, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
The computer apparatus 600 may comprise a memory, and one or more computer programs stored in the memory and configured to be executed by one or more processors to implement any of the interaction methods described above.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
It should be noted that: in the interaction device, the computer device, and the computer-readable storage medium provided in the above embodiments, when the interaction is implemented, only the division of the above functional modules is illustrated, and in practical applications, the above functions may be distributed to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the interaction apparatus, the computer device, and the computer-readable storage medium provided in the foregoing embodiments belong to the same concept as the embodiments of the interaction method, and specific implementation processes thereof are described in detail in the method embodiments and are not described herein again.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (14)

1. An interaction method is applied to a terminal, and comprises the following steps:
establishing long connection with a server;
determining the type of a current service scene, wherein the current service scene is a scene for performing data interaction with the server based on the long connection;
acquiring a scene field value according to the determined type;
and generating a link identifier by using the scene field value, and when a network request is sent to the server in the operation process of the current service scene, marking the network request by using the link identifier so that the server responds to the network request to obtain a request result, and then feeding back the request result to the terminal based on the link identifier.
2. The method of claim 1, wherein the step of determining the type to which the current traffic scenario belongs comprises:
determining a module for realizing the current service scene function;
and determining the type of the current service scene according to the function realized by the module.
3. The method of claim 2, wherein said step of generating a link identification using said scene field value is preceded by the step of:
acquiring a function field value according to the function realized by the module;
correspondingly, the step of generating a link identifier by using the scene field value includes:
and generating a link identification by using the scene field value and the function field value.
4. The method of claim 3, wherein the step of generating a link identification from the scene field value and the function field value is preceded by the step of:
acquiring identification information of a user operating in the current service scene;
correspondingly, the step of generating a link identifier according to the scene field value and the function field value includes:
and generating a link identifier according to the scene field value, the function field value and the identifier information.
5. The method of claim 3, wherein the step of generating a link identification from the scene field value and the function field value is preceded by the step of:
acquiring historical times of link identification generated aiming at the current service scene;
correspondingly, the step of generating a link identifier according to the scene field value and the function field value includes:
and generating a link identifier according to the scene field value, the function field value and the historical times.
6. The method of claim 4, wherein the step of generating a link identification from the scene field value, the function field value, and the identification information is preceded by the step of:
acquiring historical times of link identification generated aiming at the current service scene;
correspondingly, the step of generating a link identifier according to the scene field value, the function field value and the identifier information includes:
and generating a link identifier according to the scene field value, the function field value, the identification information and the historical times.
7. The method of any one of claims 1-6, further comprising:
sending an operation log search request carrying the link identifier to the server, so that the server searches an operation log according to the link identifier and feeds the operation log back to the terminal, wherein the operation log is a log for performing data interaction between the terminal and the server based on the current service scene in the long connection process;
and receiving and displaying the operation log.
8. An interaction method is applied to a server side, and the method comprises the following steps:
establishing long connection with a terminal;
receiving a network request which is sent by the terminal and carries a link identifier, wherein the link identifier is an identifier which is generated by the terminal according to the type of a current service scene and is used for marking the network request in the operation process of the current service scene, and the current service scene is a scene which is used for carrying out data interaction between the terminal and the service terminal based on the long connection;
responding the network request to obtain a request result;
and feeding back the request result to the terminal based on the link identification.
9. The method of claim 8, wherein said step of obtaining a request result in response to said network request comprises:
storing the link identification and distributing the link identification to a component used for responding to the network request in the server;
recording interaction information between the components for responding to the network request based on the link identification;
and obtaining the request result based on the interaction information.
10. The method of claim 8, wherein the method further comprises:
receiving an operation log search request which is sent by the terminal and carries the link identification, wherein the operation log is a log for performing data interaction between the terminal and the server based on the current service scene in the long connection process;
searching the operation log based on the link identification;
and feeding back the operation log to the terminal so that the terminal displays the operation log.
11. An interactive device, applied to a terminal, the device comprising:
the first establishing module is used for establishing long connection with the server;
the determining module is used for determining the type of a current service scene, wherein the current service scene is a scene for performing data interaction with the server based on the long connection;
the obtaining module is used for obtaining the scene field value according to the determined type;
and the sending module is used for generating a link identifier by using the scene field value, and marking the network request by using the link identifier when sending the network request to the server in the running process of the current service scene so that the server responds to the network request to obtain a request result, and then feeds back the request result to the terminal based on the link identifier.
12. An interactive device, applied to a server, the device comprising:
the second establishing module is used for establishing long connection with the terminal;
a receiving module, configured to receive a network request carrying a link identifier sent by the terminal, where the link identifier is an identifier that is generated by the terminal according to a type to which a current service scenario belongs and used for marking a network request in an operation process of the current service scenario, and the current service scenario is a scenario used for data interaction between the terminal and the server based on the long connection;
the response module is used for responding the network request to obtain a request result;
and the feedback module is used for feeding back the request result to the terminal based on the link identification.
The system comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving a network request which is sent by a terminal and carries a link identifier, and the link identifier is an identifier used for marking the network request in a current service scene in the operation process of the current service scene by the terminal;
the response module is used for responding the network request to obtain a request result;
and the sending module is used for sending the request result to the terminal based on the link identification.
13. A computer device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the interaction method of any one of claims 1-10.
14. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the interaction method according to any one of claims 1 to 10.
CN201910768737.0A 2019-08-20 2019-08-20 Interaction method and device Active CN110602171B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910768737.0A CN110602171B (en) 2019-08-20 2019-08-20 Interaction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910768737.0A CN110602171B (en) 2019-08-20 2019-08-20 Interaction method and device

Publications (2)

Publication Number Publication Date
CN110602171A true CN110602171A (en) 2019-12-20
CN110602171B CN110602171B (en) 2022-09-30

Family

ID=68854765

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910768737.0A Active CN110602171B (en) 2019-08-20 2019-08-20 Interaction method and device

Country Status (1)

Country Link
CN (1) CN110602171B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111382997A (en) * 2020-02-25 2020-07-07 摩拜(北京)信息技术有限公司 Vehicle using data processing method and system, server and terminal equipment
CN112559888A (en) * 2020-12-25 2021-03-26 北京明略软件系统有限公司 Recommended content tracing method and system, electronic device and readable storage medium
CN113778736A (en) * 2021-09-14 2021-12-10 北京房江湖科技有限公司 Method and device for positioning error information

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100064130A1 (en) * 2008-09-05 2010-03-11 Psion Teklogix Inc. Secure host connection
CN108833585A (en) * 2018-07-03 2018-11-16 北京小米移动软件有限公司 Information interacting method, device and storage medium
CN109189665A (en) * 2018-08-01 2019-01-11 阿里巴巴集团控股有限公司 Data recording, data readback and the method and device tested automatically
CN109327527A (en) * 2018-10-30 2019-02-12 北京摩拜科技有限公司 Control method for vehicle, server, client, vehicle and Vehicular system
CN109873717A (en) * 2019-01-18 2019-06-11 深圳壹账通智能科技有限公司 Monitoring method, device, computer equipment and storage medium
CN110113200A (en) * 2019-04-29 2019-08-09 平安科技(深圳)有限公司 The correlating method of chain-circuit system and log system, device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100064130A1 (en) * 2008-09-05 2010-03-11 Psion Teklogix Inc. Secure host connection
CN108833585A (en) * 2018-07-03 2018-11-16 北京小米移动软件有限公司 Information interacting method, device and storage medium
CN109189665A (en) * 2018-08-01 2019-01-11 阿里巴巴集团控股有限公司 Data recording, data readback and the method and device tested automatically
CN109327527A (en) * 2018-10-30 2019-02-12 北京摩拜科技有限公司 Control method for vehicle, server, client, vehicle and Vehicular system
CN109873717A (en) * 2019-01-18 2019-06-11 深圳壹账通智能科技有限公司 Monitoring method, device, computer equipment and storage medium
CN110113200A (en) * 2019-04-29 2019-08-09 平安科技(深圳)有限公司 The correlating method of chain-circuit system and log system, device and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111382997A (en) * 2020-02-25 2020-07-07 摩拜(北京)信息技术有限公司 Vehicle using data processing method and system, server and terminal equipment
CN112559888A (en) * 2020-12-25 2021-03-26 北京明略软件系统有限公司 Recommended content tracing method and system, electronic device and readable storage medium
CN113778736A (en) * 2021-09-14 2021-12-10 北京房江湖科技有限公司 Method and device for positioning error information

Also Published As

Publication number Publication date
CN110602171B (en) 2022-09-30

Similar Documents

Publication Publication Date Title
CN110602171B (en) Interaction method and device
CN107800565B (en) Inspection method, inspection device, inspection system, computer equipment and storage medium
CN106850830B (en) Service request processing method, device and system and related server
CN110659121B (en) Task data acquisition method and device, task configuration method and device and server
US20140344286A1 (en) Method and apparatus for displaying webcast roomss
WO2014183427A1 (en) Method and apparatus for displaying webcast rooms
CN105635180A (en) Message pushing method and device
CN112689202B (en) Live broadcast room message processing method and device, server and storage medium
CN103761123A (en) Method and device for function starting and terminal
CN111246238A (en) Live broadcast method, device, storage medium and live broadcast system
CN113014681A (en) Network card binding method and device of multi-network card server, electronic equipment and storage medium
CN111526185B (en) Data downloading method, device, system and storage medium
CN111756795A (en) Service information management method and device, electronic equipment and storage medium
CN111541684B (en) Signaling sending method and device of live broadcast room, server and storage medium
CN106411713B (en) State notification method and server
US10478731B2 (en) Method and apparatus for storing user data
CN113301378B (en) Broadcast signaling transmission method, device, system, electronic device and storage medium
CN106789301B (en) Method and device for generating running log of WEB gateway
CN110602172B (en) Link identification generation method and device
CN114222086A (en) Method, system, medium and electronic device for scheduling audio and video code stream
CN111224891A (en) Traffic application identification system and method based on dynamic learning triples
CN114610449B (en) Multi-cluster resource operation method and system based on unified request entry
CN109634908A (en) Data correlation method, data processing equipment and storage medium
CN115269719A (en) Data synchronization method and device
CN111212253B (en) Monitoring processing method and device in video conference, electronic equipment and storage medium

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