CN113726878A - Session processing method, system, device and storage medium in cluster environment - Google Patents

Session processing method, system, device and storage medium in cluster environment Download PDF

Info

Publication number
CN113726878A
CN113726878A CN202111001194.3A CN202111001194A CN113726878A CN 113726878 A CN113726878 A CN 113726878A CN 202111001194 A CN202111001194 A CN 202111001194A CN 113726878 A CN113726878 A CN 113726878A
Authority
CN
China
Prior art keywords
session
related information
connection request
current
server
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.)
Pending
Application number
CN202111001194.3A
Other languages
Chinese (zh)
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.)
Shenzhen Zhuiyi Technology Co Ltd
Original Assignee
Shenzhen Zhuiyi 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 Shenzhen Zhuiyi Technology Co Ltd filed Critical Shenzhen Zhuiyi Technology Co Ltd
Priority to CN202111001194.3A priority Critical patent/CN113726878A/en
Publication of CN113726878A publication Critical patent/CN113726878A/en
Pending legal-status Critical Current

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/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/26Speech to text systems
    • 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/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application relates to a session processing method, a system, equipment and a storage medium in a cluster environment. The method comprises the following steps: after a server node in a cluster receives a connection request for realizing voice recognition, a cache server receives session related information sent by the server node aiming at the connection request; the cache server runs script codes; determining the current session number of the established session under the service of the connection request based on the session related information through the script code; acquiring a session number threshold corresponding to the service recorded in the session related information, and comparing the current session number with the session number threshold through a script code; if the current session number is smaller than the session number threshold value, increasing the current session number through the script codes, and returning a first result to the server node; the first result is used to indicate that a speech recognition session is created for the connection request. Thus, the system pressure is reduced.

Description

Session processing method, system, device and storage medium in cluster environment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a session processing method, system, device, and storage medium in a cluster environment.
Background
With the popularization of artificial intelligence, voice recognition is required under various services, such as Beijing Dong customer service, Tencent qq and other different services. The voice algorithm operating platform needs to receive a large amount of voice data sent by different services and identify the voice data. When the voice algorithm operation platform is accessed, the voice algorithm operation platform needs to judge the number of sessions currently accessed by a certain service, and if the number exceeds the predefined number, the voice algorithm operation platform does not support further voice recognition.
In a cluster environment, to control the number of sessions accessed by the same service, a distributed lock is generally adopted, a plurality of service nodes access the same cache server, the distributed lock is acquired through first connection, the number of sessions is inquired through second connection, the number of sessions is set through third connection, and the distributed lock is released through fourth connection. The connection operation is frequent, reducing the system performance.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a session processing method, system, computer device and storage medium in a cluster environment, which can improve system performance.
A method of session processing in a clustered environment, the method comprising:
after a server node in a cluster receives a connection request for realizing voice recognition, a cache server receives session related information sent by the server node aiming at the connection request;
the cache server runs script codes;
determining the current session number of the created sessions under the service to which the connection request belongs through the script codes and based on the session related information;
acquiring a session quantity threshold value corresponding to the service recorded in the session related information, and comparing the current session quantity with the session quantity threshold value through the script code;
if the current session number is smaller than the session number threshold value, increasing the current session number through the script code, and returning a first result to the server node; the first result indicating that a voice recognition session was created for the connection request.
A session handling system in a clustered environment, the system comprising: a server node and a cache server;
the server node is used for sending session related information aiming at the connection request to the cache server after receiving the connection request for realizing voice recognition;
the cache server is used for receiving the session related information and operating script codes; determining the current session number of the created sessions under the service to which the connection request belongs through the script codes and based on the session related information; acquiring a session quantity threshold value corresponding to the service recorded in the session related information, and comparing the current session quantity with the session quantity threshold value through the script code;
the cache server is further configured to increase the current session number through the script code and return a first result to the server node if the current session number is smaller than the session number threshold; the first result indicating that a voice recognition session was created for the connection request.
In one embodiment, the server node is further configured to create a voice recognition session for the connection request after the server node receives the first result; the voice recognition session is a session for realizing voice recognition; the server node performs speech recognition based on the created speech recognition session.
In one embodiment, the cache server is further configured to return a second result if the current session number is equal to the session number threshold; the second result indicating not to respond to the connection request; and after receiving the second result sent by the cache server, the server node does not respond to the connection request for realizing voice recognition.
In one embodiment, the session related information sent for the connection request is first session related information; the current session number of the established session under the service of the connection request is the first current session number;
the cache server is further configured to receive, by the cache server, second session related information sent by the server node for the session disconnection request after the server node in the cluster receives the session disconnection request for the created voice recognition session; the cache server runs the script codes; determining a second current session number of the created sessions under the service to which the session disconnection request belongs based on the second session related information through the script code; reducing the second current session number through the script codes, and returning a session closing result; and the session closing result is used for indicating to close the voice recognition session aiming at the session disconnection request.
In one embodiment, the server node is further configured to obtain, by the server node in the cluster, a service identifier described by the certificate and a session number threshold corresponding to the service identifier by reading the imported certificate of the service to which the connection request belongs; after receiving a connection request for realizing voice recognition, the server node generates session related information and sends the session related information to a cache server; the session related information comprises the service identifier and a session number threshold corresponding to the service identifier; the cache server is further configured to receive the session related information sent by the server node.
In one embodiment, the cache server is further configured to obtain, by the cache server, the service identifier from the session related information through the script code; and searching the current session number corresponding to the acquired service identifier according to the corresponding relation between the pre-stored service identifier and the current session number.
In one embodiment, the session related information includes a current user identifier for initiating the connection request; the cache server stores a user identification set of the created session;
the cache server is further configured to execute the step of determining, based on the session related information, a current session number of the created session under the service to which the connection request belongs, through the script code if the current user identifier does not exist in the user identifier set; if the current user identifier exists in the user identifier set, a third result is returned to the server node; the third result is used for indicating that voice recognition is carried out in response to the connection request.
A computer device comprising a memory storing a computer program and a processor performing the steps of the above-described session handling method in a clustered environment.
A computer-readable storage medium, on which a computer program is stored, which computer program is executed by a processor for performing the steps of the above-mentioned session handling method in a clustered environment.
According to the session processing method, the session processing system, the computer equipment and the storage medium in the cluster environment, after the server node in the cluster receives the connection request for realizing the voice recognition, the server node sends the session related information aiming at the connection request to the cache server. The cache server runs script codes, determines the current session number of the created session under the service of the connection request based on the session related information, obtains a session number threshold value corresponding to the service recorded in the session related information, and compares the current session number with the session number threshold value through the script codes; and if the current session number is smaller than the session number threshold value, increasing the current session number through the script code, and returning a result for indicating to create the voice recognition session aiming at the connection request. The processing performed by executing the script code is atomic and is not interrupted by other server nodes in the process of executing the script code. Therefore, according to the scheme of the application, the server node sends the session related information to the cache server, and the script code is combined, so that the number of the service sessions can be limited only by connecting and running the script once, the connection times are greatly reduced, and the system performance is improved.
Drawings
FIG. 1 is a diagram of an application environment of a session handling method in a clustered environment in one embodiment;
FIG. 2 is a flowchart illustrating a session handling method in a cluster environment according to an embodiment;
FIG. 3 is a flowchart illustrating a session handling method in a clustered environment in an embodiment;
FIG. 4 is a schematic diagram of a session handling method in a clustered environment in one embodiment;
FIG. 5 is a block diagram that illustrates a session processing system in a clustered environment, under an embodiment;
FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The session processing method in the cluster environment provided by the present application can be applied to the application environment shown in fig. 1. Wherein the terminal 110 communicates with the server node 120 via a network, and the server node 120 communicates with the cache server 130. The terminal 110 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server node 120 may be implemented by an independent server or a server cluster formed by a plurality of servers.
The terminal 110 sends a voice recognition request for realizing voice recognition to the server node 120 in the cluster environment, the server node 120 generates session related information and sends the session related information to the cache server 130 after receiving the session related information, and the cache server 130 receives the session related information and runs script codes. The cache server 130 determines the current session number of the created sessions under the service to which the connection request belongs, based on the session related information through the script code. The cache server 130 obtains a session number threshold corresponding to the service recorded in the session related information, and compares the current session number with the session number threshold through the script code. If the current session number is smaller than the session number threshold, the cache server 130 increases the current session number through the script code and returns a first result to the server node 120. Upon receiving the first result, serving node 120 may create a voice recognition session with terminal 110.
In one embodiment, as shown in fig. 2, a session processing method in a cluster environment is provided, which may be applied to a system including a cache server and a server node and implemented by interaction between the cache server and the server node, and includes the following steps:
s202, after the server nodes in the cluster receive the connection request for realizing the voice recognition, the cache server receives the session related information sent by the server nodes aiming at the connection request.
The voice recognition is to convert voice into text. The cluster includes a plurality of server nodes. A cache server is a server that hosts frequently accessed content. The server node can communicate with different application programs of a plurality of terminals and receive voice recognition connection requests sent by the different application programs. The application program referred to in the present application refers to an application program that requires language identification and is executed on a terminal. Specifically, an application program on the terminal sends a voice recognition connection request to the server node, and based on the voice recognition request, the server node can confirm a service corresponding to the request, acquire information related to the service, obtain session related information, and send the session related information to the cache server.
In one embodiment, the cache Server may be a Redis (Remote Dictionary Server, a type of non-relational database across platforms) Server that installs a Redis service. It is understood that in addition to the Redis server, other technically implemented servers capable of hosting frequently accessed content may also be referred to as cache servers. The server node may execute a command of the client corresponding to the Redis service, and use the session related information as a parameter of the command, where the parameter of the command is received by the Redis service of the cache server, that is, the session related information sent by the server node is received by the cache server.
In one embodiment, the session related information includes at least one of a user identifier, a service identifier, a session number threshold, and the like.
In one embodiment, the voice recognition request includes at least one of a terminal identifier and an application name, wherein the terminal identifier refers to a unique identifier of a terminal on which the application is running. The server node generates a user identifier based on at least one of the terminal identifier, the server node identifier, the application name, and the like. In one embodiment, the terminal identification and the server identification may be MAC addresses of the corresponding devices.
S204, the cache server runs script codes; determining the current session number of the established session under the service of the connection request based on the session related information through the script code; and acquiring a session number threshold corresponding to the service recorded in the session related information, and comparing the current session number with the session number threshold through the script code.
The Script (Script) is an executable file written according to a certain format using a specific descriptive language. The script code includes processing logic for the caching server based on the session-related information.
In one embodiment, the script executed by the cache server is a lua script, which is a small script language. The execution of the lua script by the cache server is atomic, and the next lua script can be continuously executed after the execution of the lua script by the cache server is finished once.
Specifically, the cache server stores the current session number of the created session corresponding to each service. The cache server can obtain the corresponding current conversation quantity by running the script code, and compares the current conversation quantity with the conversation quantity threshold value in the conversation related information, thereby judging whether the voice recognition conversation is agreed to be created.
In one embodiment, the cache server may determine that it is approved to create a speech recognition session if the number of current sessions is less than the number of sessions threshold.
In one embodiment, the cache server may determine that the speech recognition session is not approved for creation if the current number of sessions is equal to the threshold number of sessions.
In an embodiment, if the interaction frequency with the server node is greater than a preset value and the current session number is equal to the session number threshold, the cache server may determine that the creation of the voice recognition session is not approved, notify the server node to suspend the interaction, and wait for a preset duration or continue the interaction after receiving a message that the interaction can be continued.
In one embodiment, if it is determined that the voice recognition session is approved to be created, the cache server may update the current session number of the corresponding service.
It can be understood that due to the atomicity characteristic of the lua script, the cache server reads and updates the current session number based on the lua script, the accuracy of the data is guaranteed, and errors of related data caused by asynchronous operation among a plurality of server nodes can be avoided. And the processing to be executed can be completed by executing the lua script once without multiple interactions, thereby improving the system performance and reducing the system pressure.
S206, if the current session number is smaller than the session number threshold value, increasing the current session number through the script codes, and returning a first result to the server node; a first result indicating that a voice recognition session is created for the connection request.
Specifically, if the cache server judges that the current session number is smaller than the session number threshold, the cache server adds one to the current session number and returns a first result to the server node, and the server node receives the first result and creates a voice recognition session with the application program.
It can be understood that the server node creates the speech recognition session according to the first result returned by the cache server, so that the cache server limits the total number of sessions created by a plurality of server nodes for the same service, thereby playing a role of centrally controlling the total number of sessions in the cluster environment,
according to the session processing method under the cluster environment, after the server node in the cluster receives the connection request for realizing the voice recognition, the server node sends the session related information aiming at the connection request to the cache server. The cache server runs script codes, determines the current session number of the created session under the service of the connection request based on the session related information, acquires a session number threshold value corresponding to the service recorded in the session related information, and compares the current session number with the session number threshold value through the script codes; and if the current session number is smaller than the session number threshold value, increasing the current session number through the script codes, and returning a result for indicating that the voice recognition session is created aiming at the connection request. The processing performed by executing the script code is atomic and is not interrupted by other server nodes in the process of executing the script code. Therefore, according to the scheme of the application, the server node sends the session related information to the cache server, and the script code is combined, so that the number of the service sessions can be limited only by connecting and running the script once, the connection times are greatly reduced, and the system performance is improved.
In one embodiment, the method further comprises: after receiving the first result, the server node creates a voice recognition session aiming at the connection request; a voice recognition session, which is a session for realizing voice recognition; the server node performs voice recognition based on the created voice recognition session.
Specifically, after the server node receives the first result, the server node creates a session for implementing voice recognition, and the user may generate voice information using an application program on the terminal, and the application program sends the voice information to the server node based on the voice recognition session. The server node may perform a speech recognition algorithm to perform speech recognition on the speech information received by the session, and return a speech recognition result to the application program on the terminal based on the session after performing the speech recognition algorithm.
In one embodiment, the server node may establish speech recognition sessions with applications on multiple terminals, execute speech recognition algorithms in sequence in one thread and return speech recognition results to the applications on the terminals.
In another embodiment, the server node establishes speech recognition sessions with different applications on a plurality of different terminals, one application on one terminal corresponding to one thread, each thread executing a speech recognition algorithm and returning speech recognition results to the corresponding application on the terminal.
In this embodiment, the server node creates a speech recognition session after receiving the first result, performs speech recognition, and is limited to the returned result of the cache server. In the cluster environment, whether a voice recognition session is created or not is indicated by a unique cache server according to the number of sessions, so that the accurate limitation of the cluster environment on the session number threshold of the service is ensured.
In one embodiment, the method further comprises: if the current session number is equal to the session number threshold value, the cache server returns a second result; a second result indicating that the connection request is not responded to; and after receiving the second result sent by the cache server, the server node does not respond to the connection request for realizing the voice recognition.
Specifically, the server node does not create a speech recognition session with the application program on the terminal upon receiving the second result, and sends a connection failure result to the application program on the terminal.
In one embodiment, the server node may send a timeout duration to the application on the terminal, and the application on the terminal waits for the timeout duration before initiating the connection request again.
In an embodiment, the server node obtains the second result, may determine that the current session number is equal to the session number threshold, and after waiting for a timeout period, the server node sends the session related information to the cache server based on the connection request of the terminal.
In this embodiment, the server node knows that the current session number is equal to the session number threshold based on the second result, and rejects to create the voice recognition session, thereby ensuring accurate limitation of the cluster environment on the session number threshold of the service, and avoiding too frequent connection request initiation due to the fact that the current session number is equal to the session number threshold, thereby reducing the pressure of the system.
In one embodiment, the session related information sent for the connection request is first session related information; the current session number of the established session under the service of the connection request is the first current session number; as shown in fig. 3, the method comprises the steps of:
s306, after the server node in the cluster receives the session disconnection request aiming at the created voice recognition session, the cache server receives second session related information sent by the server node aiming at the session disconnection request.
The second session related information includes at least one of a user identifier and a service identifier.
Specifically, when the application program on the terminal does not need to continue voice recognition, a session disconnection request is sent to the server node, and the server node sends second session related information to the cache server based on the session disconnection request.
S304, the cache server runs script codes; and determining a second current session number of the created sessions under the service to which the session disconnection request belongs through the script code based on the second session related information.
Specifically, the cache server obtains a service identifier and a user identifier based on the second session related information. And the cache server searches and obtains the current session number corresponding to the service based on the service identifier.
In an embodiment, the cache server does not find the current session number corresponding to the service identifier, does not execute step S306, and directly returns the session closing result.
In one implementation, the cache server does not search for the user identifier from the user identifier set, and does not perform step S306, and directly returns the session closing result.
S306, reducing the number of the second current sessions through the script codes, and returning a session closing result; a session close result indicating that the voice recognition session for which the session disconnection request is directed is closed.
Specifically, the cache server reduces the number of current sessions corresponding to the service, and deletes the user identifier from the user identifier set. And returning a session closing result to the server node, and closing the voice recognition session corresponding to the application program on the terminal after the server receives the session closing result.
In one implementation, the server node may send a message to the application on the terminal that the session disconnection was successful after closing the speech recognition session.
In one implementation, the server node receives a session disconnection request of an application program during execution of a speech recognition algorithm for the application program on the terminal, and may then not send speech recognition algorithm results to the application program any more.
In this embodiment, the server node interacts with the cache server based on the session disconnection request, and the cache server executes the script once to update the current session number without multiple interactions, thereby improving the system performance and reducing the system pressure.
In one embodiment, after a server node in a cluster receives a connection request for implementing voice recognition, the receiving, by a cache server, session-related information sent by the server node for the connection request includes: a server node in a cluster acquires a service identifier described by a certificate and a session number threshold corresponding to the service identifier by reading the certificate of the service to which the imported connection request belongs; after receiving a connection request for realizing voice recognition, the server node generates session related information and sends the session related information to a cache server; the session related information comprises a service identifier and a session number threshold corresponding to the service identifier; and the cache server receives the session related information sent by the server node.
The session number threshold is an upper limit value of the session number of the same service at the same time. The server creates a speech recognition session based on a connection request of an application on a terminal.
Specifically, the server node may import at least one certificate of different services, obtain a service identifier described by the certificate and a corresponding session number threshold, and store the service identifier and the corresponding session number threshold in a local database. After receiving a connection request sent by an application program on the terminal, the server confirms a service identifier from the connection request, searches a corresponding session number threshold from a database based on the service identifier, generates session related information, and sends the session related information to the cache server.
In an embodiment, the server finds that the corresponding session number threshold is not obtained based on the service identifier, and sends a connection failure message to an application program on the terminal to notify that the service is not supported based on the imported certificate.
In this embodiment, the server node obtains the service identifier and the session number threshold by reading the imported certificate, and generates session related information including the service identifier and the session number threshold to the cache server for the connection request, so that the server node can limit the type of the accessed service and the session number threshold to which the service can be accessed according to the certificate.
In one embodiment, determining, by the script code, a current number of sessions of created sessions under a service to which the connection request belongs based on the session-related information includes: the cache server acquires a service identifier from the session related information through the script code; and searching the current session number corresponding to the acquired service identifier according to the corresponding relation between the pre-stored service identifier and the current session number.
Specifically, the cache server stores a data set in which service identifiers and the number of current sessions are in one-to-one correspondence. The cache server executes the code, obtains the service identification from the session related information, and searches the data set to obtain the current session number.
In one embodiment, the cache server searches for the current session number from the data set, adds a service identifier to the data set, and sets the current session number value corresponding to the service to 1.
In this embodiment, the number of current sessions is found by obtaining the service identifier in the session related information, and it is ensured that each service has a one-to-one correspondence to the number of current sessions, thereby implementing management of the number of sessions of different services.
In one embodiment, the session related information includes a current user identifier for initiating the connection request; the cache server stores a user identification set of the created session; the method further comprises the following steps: if the current user identification does not exist in the user identification set, executing a step of determining the current session number of the created session under the service of the connection request based on the session related information through a script code; if the current user identifier exists in the user identifier set, a third result is returned to the server node; a third result indicating that speech recognition is performed in response to the connection request.
Specifically, before the cache server returns the first result, the user identifier in the session related information is stored in the user identifier set.
Specifically, when receiving the session related information, the cache server obtains a current user identifier, and searches the current user identifier in the user identifier set. If the search fails, determining that the current user identifier is a new user identifier, and executing the step S204; if the search is successful, it indicates that the application program on the terminal corresponding to the current user identifier has already created a session. And returning a third result, and informing the server node that the voice recognition session is established.
In one embodiment, the server node receives the third result, determines that a speech recognition session has been created with the application, closes the previous speech recognition session, and re-establishes a new speech recognition session.
In one embodiment, when the cache server searches for or stores the user identifier, the refresh time of the user identifier is recorded as the current time. And the cache server judges the difference value between the refreshing time of the user identifier and the system time at intervals, judges that the application program on the terminal corresponding to the user identifier is offline after a preset active time is exceeded, and deletes the user identifier in the user identifier set. If the application program on the terminal corresponding to the user identifier initiates a voice recognition connection request, the step of S204 is also required.
In one embodiment, the cache server may prioritize different applications. The priority is high, the set active time is long, the priority is low, and the set active time is short. Specifically, the cache server extracts information of the application program from the user identifier, and sets corresponding active time.
In this embodiment, the cache server stores, reads, and determines the user identifier, which facilitates management and statistics of the application programs on different terminals, and enables the cache server in the cluster to limit the active time of the speech recognition sessions of different application programs.
In one embodiment, as shown in FIG. 4, a schematic diagram of a session handling method in a clustered environment is provided. Referring to fig. 4, a plurality of server nodes (i.e., a plurality of application servers) are deployed in the cluster environment, and the plurality of server nodes interface with the same cache server. At least one application program is installed on the terminal, and the application programs installed on different terminals can be the same or different, which is not limited.
Each user may use an application program on its own terminal, and when using the application program to perform voice recognition related operations, may send a connection request for implementing voice recognition to a corresponding server node through the application program, and the server node may send session related information to the cache server for the connection request, for example, may transmit information such as a session number threshold corresponding to a service to which the connection request belongs to the cache server. The cache server may run the script code, determine the current session number of the created sessions under the service, compare the current session number with the session number threshold, if the current session number is smaller than the session number threshold, the cache server may increase the current session number through the script code, and return a first result to the server node to indicate that the voice recognition session may be created for the connection request.
In one embodiment, the cache server may be a Redis server and the scripting code may be lua scripts.
It should be understood that, although the steps in the flowcharts in the embodiments of the present application are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flow chart may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or the stages is not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a part of the steps or the stages in other steps.
In one embodiment, as shown in fig. 5, there is provided a conversation processing system 500 comprising: a server node 502 and a cache server 504, wherein:
the server node 502 is configured to, after receiving a connection request for implementing voice recognition, send session-related information for the connection request to the cache server 504.
A cache server 504, configured to receive session-related information and run script codes; determining the current session number of the established session under the service of the connection request based on the session related information through the script code; and acquiring a session quantity threshold value corresponding to the service recorded in the session related information, and comparing the current session quantity with the session quantity threshold value through the script code.
The cache server 504 is further configured to increase the current session number by using the script code if the current session number is smaller than the session number threshold, and return a first result to the server node 502; a first result indicating that a voice recognition session is created for the connection request.
In one embodiment, server node 502 is further configured to, upon receiving the first result, create a voice recognition session for the connection request; a voice recognition session, which is a session for realizing voice recognition; based on the created speech recognition session, speech recognition is performed.
In one embodiment, the cache server 504 is further configured to return a second result if the current number of sessions is equal to the session number threshold; a second result indicating that the connection request is not responded to. The server node 502 is further configured to not respond to the connection request for implementing speech recognition after receiving the second result sent by the cache server 504.
In one embodiment, the session related information sent for the connection request is first session related information; the current session number of the established session under the service of the connection request is the first current session number;
the cache server 504 is further configured to, after the server node 502 in the cluster receives the session disconnection request for the created voice recognition session, receive, by the cache server 504, second session related information sent by the server node 502 for the session disconnection request; the cache server 504 runs script code; determining a second current session number of the created sessions under the service to which the session disconnection request belongs through the script code and based on the second session related information; the cache server 504 reduces the second current session number by the script code and returns a session closing result; a session close result indicating that the voice recognition session for which the session disconnection request is directed is closed.
In an embodiment, the server node 502 is further configured to obtain, by the server node 502 in the cluster, a service identifier described by the certificate and a session number threshold corresponding to the service identifier by reading a certificate of a service to which the imported connection request belongs; after receiving the connection request for implementing voice recognition, the server node 502 generates session related information and sends the session related information to the cache server 504; the session related information comprises a service identifier and a session number threshold corresponding to the service identifier; the cache server 504 is further configured to receive the session related information sent by the server node 502.
In one embodiment, the cache server 504 is further configured to obtain the service identifier from the session related information through a script code; and searching the current session number corresponding to the acquired service identifier according to the corresponding relation between the pre-stored service identifier and the current session number.
In one embodiment, the session related information includes a current user identifier for initiating the connection request; the cache server 504 stores the set of user identifications for which the session has been created; the cache server 504 is further configured to execute a step of determining, based on the session related information, a current session number of a created session under a service to which the connection request belongs, through a script code, if the current user identifier does not exist in the user identifier set; if the current user identifier exists in the user identifier set, a third result is returned to the server node 502; a third result indicating that speech recognition is performed in response to the connection request.
In the session processing system 400 in the cluster environment, after the server node 502 in the cluster receives the connection request for implementing voice recognition, the server node 502 sends session related information for the connection request to the cache server 504. The cache server 504 runs the script code, determines the current session number of the created session under the service to which the connection request belongs based on the session related information, obtains the session number threshold corresponding to the service recorded in the session related information, and compares the current session number with the session number threshold through the script code; and if the current session number is smaller than the session number threshold value, increasing the current session number through the script codes, and returning a result for indicating that the voice recognition session is created aiming at the connection request. The processing performed to execute the script code is atomic and is not interrupted by other server nodes 502 in the process of executing the script code. Therefore, in the scheme of the application, the server node 502 sends the session related information to the cache server 504, and in combination with the script code, the number of service sessions can be limited only by connecting and running the script once, and the connection times are greatly reduced, so that the system performance is improved.
For the specific limitation of the session processing system in the cluster environment, reference may be made to the above limitation on the session processing method in the cluster environment, and details are not described here. Each device in the session processing system in the cluster environment can be wholly or partially implemented by software, hardware and a combination thereof. The above devices may be embedded in hardware or independent from a processor in the computer device, or may be stored in a memory in the computer device in software, so that the processor can call and execute operations corresponding to the above devices.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing session related data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of session handling in a clustered environment.
Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for session handling in a clustered environment, the method comprising:
after a server node in a cluster receives a connection request for realizing voice recognition, a cache server receives session related information sent by the server node aiming at the connection request;
the cache server runs script codes;
determining the current session number of the created sessions under the service to which the connection request belongs through the script codes and based on the session related information;
acquiring a session quantity threshold value corresponding to the service recorded in the session related information, and comparing the current session quantity with the session quantity threshold value through the script code;
if the current session number is smaller than the session number threshold value, increasing the current session number through the script code, and returning a first result to the server node; the first result indicating that a voice recognition session was created for the connection request.
2. The method of claim 1, further comprising:
after receiving the first result, the server node creates a voice recognition session aiming at the connection request; the voice recognition session is a session for realizing voice recognition;
the server node performs speech recognition based on the created speech recognition session.
3. The method of claim 1, further comprising:
if the current session number is equal to the session number threshold value, the cache server returns a second result; the second result indicating not to respond to the connection request;
and after receiving the second result sent by the cache server, the server node does not respond to the connection request for realizing voice recognition.
4. The method according to claim 1, wherein the session-related information sent for the connection request is first session-related information; the current session number of the established session under the service of the connection request is the first current session number;
the method further comprises the following steps:
after a server node in a cluster receives a session disconnection request aiming at a created voice recognition session, a cache server receives second session related information sent by the server node aiming at the session disconnection request;
the cache server runs the script codes;
determining a second current session number of the created sessions under the service to which the session disconnection request belongs based on the second session related information through the script code;
reducing the second current session number through the script codes, and returning a session closing result; and the session closing result is used for indicating to close the voice recognition session aiming at the session disconnection request.
5. The method of claim 1, wherein after the server nodes in the cluster receive the connection request for implementing voice recognition, the receiving, by the cache server, the session-related information sent by the server nodes for the connection request comprises:
a server node in the cluster acquires a service identifier described by the certificate and a session number threshold corresponding to the service identifier by reading the imported certificate of the service to which the connection request belongs;
after receiving a connection request for realizing voice recognition, the server node generates session related information and sends the session related information to a cache server; the session related information comprises the service identifier and a session number threshold corresponding to the service identifier;
and the cache server receives the session related information sent by the server node.
6. The method according to claim 5, wherein the determining, by the script code and based on the session-related information, the current number of sessions of the created session under the service to which the connection request belongs comprises:
the cache server acquires the service identifier from the session related information through the script code;
and searching the current session number corresponding to the acquired service identifier according to the corresponding relation between the pre-stored service identifier and the current session number.
7. The method according to any one of claims 1 to 6, wherein the session related information includes a current user identifier for initiating the connection request; the cache server stores a user identification set of the created session;
the method further comprises the following steps:
if the current user identifier does not exist in the user identifier set, executing the step of determining the current session number of the created session under the service to which the connection request belongs through the script code and based on the session related information;
if the current user identifier exists in the user identifier set, a third result is returned to the server node; the third result is used for indicating that voice recognition is carried out in response to the connection request.
8. A session processing system in a clustered environment, the system comprising: a server node and a cache server;
the server node is used for sending session related information aiming at the connection request to the cache server after receiving the connection request for realizing voice recognition;
the cache server is used for receiving the session related information and operating script codes; determining the current session number of the created sessions under the service to which the connection request belongs through the script codes and based on the session related information; acquiring a session quantity threshold value corresponding to the service recorded in the session related information, and comparing the current session quantity with the session quantity threshold value through the script code;
the cache server is further configured to increase the current session number through the script code and return a first result to the server node if the current session number is smaller than the session number threshold; the first result indicating that a voice recognition session was created for the connection request.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202111001194.3A 2021-08-30 2021-08-30 Session processing method, system, device and storage medium in cluster environment Pending CN113726878A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111001194.3A CN113726878A (en) 2021-08-30 2021-08-30 Session processing method, system, device and storage medium in cluster environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111001194.3A CN113726878A (en) 2021-08-30 2021-08-30 Session processing method, system, device and storage medium in cluster environment

Publications (1)

Publication Number Publication Date
CN113726878A true CN113726878A (en) 2021-11-30

Family

ID=78678831

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111001194.3A Pending CN113726878A (en) 2021-08-30 2021-08-30 Session processing method, system, device and storage medium in cluster environment

Country Status (1)

Country Link
CN (1) CN113726878A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107592283A (en) * 2016-07-06 2018-01-16 中兴通讯股份有限公司 The assisted method and mobile terminal of a kind of mobile terminal
CN108390908A (en) * 2018-01-10 2018-08-10 努比亚技术有限公司 A kind of data request processing method, apparatus and computer readable storage medium
US20180324260A1 (en) * 2017-05-02 2018-11-08 Servicenow, Inc. System and method for limiting active sessions
CN109087055A (en) * 2018-06-06 2018-12-25 北京达佳互联信息技术有限公司 The control method and device of service request
CN112751748A (en) * 2020-12-28 2021-05-04 百果园技术(新加坡)有限公司 Session message management method, device, server and readable storage medium
CN112929291A (en) * 2021-02-18 2021-06-08 欧冶云商股份有限公司 Distributed current limiting method based on redis, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107592283A (en) * 2016-07-06 2018-01-16 中兴通讯股份有限公司 The assisted method and mobile terminal of a kind of mobile terminal
US20180324260A1 (en) * 2017-05-02 2018-11-08 Servicenow, Inc. System and method for limiting active sessions
CN108390908A (en) * 2018-01-10 2018-08-10 努比亚技术有限公司 A kind of data request processing method, apparatus and computer readable storage medium
CN109087055A (en) * 2018-06-06 2018-12-25 北京达佳互联信息技术有限公司 The control method and device of service request
CN112751748A (en) * 2020-12-28 2021-05-04 百果园技术(新加坡)有限公司 Session message management method, device, server and readable storage medium
CN112929291A (en) * 2021-02-18 2021-06-08 欧冶云商股份有限公司 Distributed current limiting method based on redis, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108449405B (en) Event reminding method and device, computer equipment and storage medium
CN110620812B (en) Interactive information pushing method and device, computer equipment and storage medium
US20210117231A1 (en) Task processing method and apparatus
CN111770355B (en) Media server determination method, device, server and storage medium
CN111341315B (en) Voice control method, device, computer equipment and storage medium
CN108595280B (en) Interface adaptation method and device, computer equipment and storage medium
CN112527504A (en) Multi-tenant resource quota management method and device, and computer equipment
CN114244890B (en) RPA server cluster control method and system
CN113590169B (en) Application deployment method, application deployment system, and computer-readable storage medium
WO2017181465A1 (en) Access point name configuration method and device
CN113630418A (en) Network service identification method, device, equipment and medium
CN113726878A (en) Session processing method, system, device and storage medium in cluster environment
CN109857344B (en) Heartbeat state judgment method and device based on shared memory and computer equipment
CN111782447A (en) Batch test updating method and device based on SSH service and computer equipment
CN114610446B (en) Method, device and system for automatically injecting probe
CN114630323A (en) Voice call service processing method and device and computer readable storage medium
CN109104321B (en) Method for improving Web _ HDFS availability under Hadoop dual-computer cluster
CN112799849A (en) Data processing method, device, equipment and storage medium
CN117640363B (en) Micro-service configuration and management and control method and system
CN112989147A (en) Data information pushing method and device, computer equipment and storage medium
CN112235842A (en) Communication method and device of Internet of things equipment
CN112954087A (en) Domain name connection method and device for SaaS (software as a service), computer equipment and storage medium
CN111064636A (en) Control method, device and system for connection of front-end processor and computer equipment
CN114584625B (en) Message processing method and device, electronic equipment and storage medium
CN115622988B (en) Call response method and device for web interface, 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