CN111885198B - Message processing method, system and device and electronic setting - Google Patents

Message processing method, system and device and electronic setting Download PDF

Info

Publication number
CN111885198B
CN111885198B CN202010761914.5A CN202010761914A CN111885198B CN 111885198 B CN111885198 B CN 111885198B CN 202010761914 A CN202010761914 A CN 202010761914A CN 111885198 B CN111885198 B CN 111885198B
Authority
CN
China
Prior art keywords
processing
target
session
streaming
target session
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.)
Active
Application number
CN202010761914.5A
Other languages
Chinese (zh)
Other versions
CN111885198A (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.)
Beijing Sinovoice Technology Co Ltd
Original Assignee
Beijing Sinovoice 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 Beijing Sinovoice Technology Co Ltd filed Critical Beijing Sinovoice Technology Co Ltd
Priority to CN202010761914.5A priority Critical patent/CN111885198B/en
Publication of CN111885198A publication Critical patent/CN111885198A/en
Application granted granted Critical
Publication of CN111885198B publication Critical patent/CN111885198B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session

Abstract

The application discloses a message processing method, a system, a device and electronic settings. The method comprises the following steps: receiving a processing request of a target fragment, wherein the target fragment is any fragment in a target session; inquiring whether a streaming task of a target session exists in a task stream to be handled, wherein the streaming task of the target session is established based on a processing request of any one fragment of the target session; judging whether the streaming task of the target session carries an overload tag or not under the condition of existence; and adding the target fragments into the streaming task of the target session and processing the streaming task of the target session under the condition that the streaming task of the target session does not carry the overload tag. According to the method and the device, the problem of packet loss in a large amount under the condition of overload flow when the HTTP protocol is adopted to finish the streaming task in the related technology is solved.

Description

Message processing method, system and device and electronic setting
Technical Field
The present disclosure relates to the field of message processing technologies, and in particular, to a method, a system, an apparatus, and an electronic device for processing a message.
Background
Sentence speech recognition is commonly found in smart homes, voice assistants, and other scenarios. For example, the user uses a remote controller or a mobile phone to input voice, firstly presses a button or starts recording, then speaks an instruction, finally presses the button or releases the button again to finish recording, compresses the recording in the process, and sends the compressed recording to a voice recognition server in a streaming slicing mode to perform voice recognition.
In the related technology, due to the http protocol standard, the interface call is easy to realize data transmission in a sentence voice recognition process by using the http protocol, specifically, when the client sends the audio, the request header carries the information of the unique identifier, the fragment serial number, the end identifier and the like of the session, the server receives the request with the fragment serial number of 1, creates a streaming task, waits for each fragment to arrive in the streaming task, and starts voice recognition after all fragments arrive. Specifically, under the unique identifier of the same session, there are fragments with consecutive sequence numbers starting from 1, and one fragment with the largest sequence number has an end identifier, i.e. indicates that a full portion of fragments arrive. However, when the http protocol is used to realize the defect of data transmission, each fragment of the http protocol is logically independent, so that the problems of fragment packet loss or fragment arrival disorder and the like may occur sporadically in actual service.
It should be further noted that, to avoid the problem of service access caused by burst large traffic, it is generally necessary to set the number of threads of overload protection according to the equivalent test result; in order to avoid the problem of abnormal requests such as client-side sending errors or network blocking, waiting timeout time is generally required to be set for each fragment and each session respectively, after the waiting timeout time exceeds the appointed time, the subsequent procedure can not be triggered, the error can be returned in a timeout mode, and resources occupied by the current fragment or session are cleared.
Specifically, for the scene of low traffic or network stability, even if the problem of occasional packet loss or arrival disorder of the fragments exists, the service usage of the whole system is not affected. However, for a scenario of high traffic or unstable network, the number of requests may be larger than the number of threads for overload protection, and once the problem occurs, the requests arriving after exceeding the number of threads may directly return an error, be actively discarded, and be no longer processed. The client still can continue to send other request fragments of the session, and as long as one fragment is not processed due to overload in the session, the rest fragments wait until the waiting time is out; subsequent traffic returns below the overload number of threads and there are also a number of pending requests that have already taken up the number of threads, so that the number of requests that the system can actually handle normally is far below the expected value. At this time, overload of part of the fragments is not processed, and the rest fragments continue to occupy threads for waiting, so that vicious circle occurs, and the system cannot normally process service requests gradually. From the perspective of users, after the user quantity is suddenly increased, a part of overloaded users cannot be used at first, the flow gradually returns to normal over time, but more and more users cannot be used, and finally the system cannot be used by all users.
Aiming at the problem of a large amount of packet loss under the condition of overload flow when the HTTP protocol is adopted to complete the streaming task in the related technology, no effective solution is proposed at present.
Disclosure of Invention
The application provides a message processing method, a system, a device and electronic setting, which are used for solving the problem of massive packet loss under the condition of overload flow when an HTTP protocol is adopted to finish a streaming task in the related technology.
According to one aspect of the present application, a message processing method is provided. The method comprises the following steps: receiving a processing request of a target fragment, wherein the target fragment is any fragment in a target session; inquiring whether a streaming task of a target session exists in a task stream to be handled, wherein the streaming task of the target session is established based on a processing request of any one fragment of the target session; judging whether the streaming task of the target session carries an overload tag or not under the condition of existence; and adding the target fragments into the streaming task of the target session and processing the streaming task of the target session under the condition that the streaming task of the target session does not carry the overload tag.
Optionally, before querying whether the streaming task of the target session exists in the task stream to be handled, the method further includes: determining whether a target operation currently exists, wherein the target operation comprises one of the following: querying the operation of the streaming task and creating the operation of the streaming task; and executing the step of inquiring whether the streaming task of the target session exists in the task stream to be handled under the condition that the target operation does not exist currently.
Optionally, in the case that the streaming task of the target session does not carry the overload tag, adding the target fragment to the streaming task of the target session, and processing the streaming task of the target session includes: judging whether the number of the existing processing requests of the fragments is greater than or equal to the number of the overload threads of the requests; adding the target fragments into the streaming tasks of the target session under the condition that the number of the existing processing requests of the fragments is greater than or equal to the number of the overload threads of the requests, and performing first processing on the streaming tasks of the target session; and adding the target fragments into the streaming tasks of the target session under the condition that the number of processing requests of the existing fragments is smaller than the number of the overload threads, and performing second processing on the streaming tasks of the target session.
Optionally, in a case that the number of processing requests of the existing fragments is greater than or equal to the number of overload threads of the request, adding the target fragments to the streaming task of the target session, and performing the first processing on the streaming task of the target session includes: judging whether an idle request processing thread exists in a preset time; under the condition that idle request processing threads exist in preset time, adding the target fragments into the streaming task of the target session; and discarding the target fragments under the condition that no idle request processing thread exists within the preset time, and releasing the session processing threads occupied by the streaming tasks of the target session and the request processing threads occupied by the fragments in the streaming tasks of the target session.
Optionally, in a case where the number of processing requests of the existing fragments is smaller than the number of overload threads of the request, adding the target fragments to the streaming task of the target session, and performing the second processing on the streaming task of the target session includes: adding the target fragments into the streaming task of the target session; judging whether the fragments existing in the streaming task of the target session are equal to the fragments contained in the target session or not; and executing the step of analyzing and processing the target session in the case that the fragments existing in the streaming task of the target session are equal to the fragments contained in the target session.
Optionally, after querying whether the streaming task of the target session already exists in the task stream to be handled, the method further includes: judging whether the number of streaming tasks of the current session is greater than or equal to the number of session overload threads or not under the condition that the current session does not exist; creating streaming tasks of the target session and creating overload labels for the streaming tasks of the target session under the condition that the number of streaming tasks of the current session is greater than or equal to the number of session overload threads; in the case where the number of streaming tasks for the currently existing session is less than the number of session overload threads, streaming tasks for the target session are created that do not carry an overload tag.
Optionally, after determining whether the streaming task of the target session carries the overload tag if the streaming task exists, the method further includes: and discarding the target fragments under the condition that the streaming task of the target session carries the overload label.
According to another aspect of the present application, a message processing system is provided. The system comprises: the client is used for sending a processing request of the target fragments, wherein the target fragments are any fragments in the target session; the server side is used for receiving the processing request of the target fragment and inquiring whether the streaming task of the target session exists in the task flow to be handled, wherein the streaming task of the target session is established based on the processing request of any fragment of the target session; judging whether the streaming task of the target session carries an overload tag or not under the condition of existence; and adding the target fragments into the streaming task of the target session under the condition that the streaming task of the target session does not carry the overload label, processing the streaming task of the target session, and sending the processing result to the client.
According to another aspect of the present application, a message processing apparatus is provided. The device comprises: the receiving unit is used for receiving a processing request of a target fragment, wherein the target fragment is any fragment in a target session; the query unit is used for querying whether the streaming task of the target session exists in the task stream to be handled, wherein the streaming task of the target session is established based on the processing request of any one fragment of the target session; the first judging unit is used for judging whether the streaming task of the target session carries an overload tag or not under the condition of existence; and the processing unit is used for adding the target fragments to the streaming task of the target session and processing the streaming task of the target session under the condition that the streaming task of the target session does not carry the overload label.
According to another aspect of the embodiment of the present invention, there is also provided an electronic device including a processor and a memory; the memory has stored therein computer readable instructions for execution by the processor, wherein the computer readable instructions when executed perform a message processing method.
Through the application, the following steps are adopted: receiving a processing request of a target fragment, wherein the target fragment is any fragment in a target session; inquiring whether a streaming task of a target session exists in a task stream to be handled, wherein the streaming task of the target session is established based on a processing request of any one fragment of the target session; judging whether the streaming task of the target session carries an overload tag or not under the condition of existence; under the condition that the streaming task of the target session does not carry an overload tag, adding the target fragment into the streaming task of the target session, and processing the streaming task of the target session, the problem of massive packet loss under the condition of overload flow when the streaming task is completed by adopting an http protocol in the related technology is solved. And further achieves the effect of reducing packet loss under the condition of overload flow.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application, illustrate and explain the application and are not to be construed as limiting the application. In the drawings:
FIG. 1 is a flow chart of a message processing method provided in accordance with an embodiment of the present application;
FIG. 2 is a schematic diagram of a message processing system provided in accordance with an embodiment of the present application;
FIG. 3 is a flow chart of another message processing method provided in accordance with an embodiment of the present application; and
fig. 4 is a schematic diagram of a message processing apparatus provided according to an embodiment of the present application.
Detailed Description
It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe the embodiments of the present application described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an embodiment of the application, a message processing method is provided.
Fig. 1 is a flow chart of a message processing method according to an embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
step S101, receiving a processing request of a target fragment, wherein the target fragment is any fragment in a target session.
Specifically, the processing request of the target fragment is sent by the client and received by the server.
Step S102, inquiring whether a streaming task of a target session exists in the task stream to be handled, wherein the streaming task of the target session is established based on a processing request of any one fragment of the target session.
It should be noted that, the processing request of the target slice received by the server may not be the first slice request, that is, the request of the slice with the first sequence number in the target session. In the embodiment of the application, whether the received request of the first fragment is the first fragment request or not, the creation of the streaming task is performed under the condition that the streaming task is not stored.
That is, in the embodiment of the present application, the server creates the streaming task of the session according to the received first slicing request, rather than creating the streaming task of the session according to the first slicing request only.
It should be further noted that, the first slicing request sent by the client end due to the network causes arrives at the end, and other slices in the related art additionally occupy interface resources to wait.
In addition, after the processing request of the fragments arrives, the embodiment of the application firstly carries out the flow task query according to the unique identifier of the request head, the unique identifier is used for representing the unique session, if the flow task corresponding to the unique identifier is queried, the request is not the first received request, and the flow task does not need to be created; if no streaming task corresponding to the unique identifier is queried, the request is the first received request to create the streaming task with the unique identifier.
In order to avoid conflict in creating a streaming task, optionally, in the message processing method provided in the embodiment of the present application, before querying whether a streaming task of a target session already exists in a task to-do stream, the method further includes: determining whether a target operation currently exists, wherein the target operation comprises one of the following: querying the operation of the streaming task and creating the operation of the streaming task; and executing the step of inquiring whether the streaming task of the target session exists in the task stream to be handled under the condition that the target operation does not exist currently.
It should be noted that, when a streaming task is created, only one streaming task is created or queried, and other streaming tasks are not allowed to be created or queried at the same time, so that the request of the same session is ensured not to create repeated streaming tasks, and the creation of the same session as different streaming tasks or the creation of different sessions as the same streaming task, that is, the creation of conflicting tasks of streaming tasks, is avoided.
Optionally, in the message processing method provided in the embodiment of the present application, after querying whether a streaming task of a target session already exists in a task stream to be handled, the method further includes: judging whether the number of streaming tasks of the current session is greater than or equal to the number of session overload threads or not under the condition that the current session does not exist; creating streaming tasks of the target session and creating overload labels for the streaming tasks of the target session under the condition that the number of streaming tasks of the current session is greater than or equal to the number of session overload threads; in the case where the number of streaming tasks for the currently existing session is less than the number of session overload threads, streaming tasks for the target session are created that do not carry an overload tag.
The method is characterized in that the number of the conversation overload threads is set, conversation is used as dimension current limiting when the flow is overloaded, and the service end marks when creating the streaming task of the conversation, so that the influence of active packet loss of the fragments on the service during overload can be effectively avoided.
Specifically, when the number of session threads is full, the service interface receives the first fragment request, creates a streaming task, and tags the streaming task with the thread full overload. When the session threads are not full, the interface of the server receives the request of the first fragment, and the streaming task is normally created.
Step S103, if so, judging whether the streaming task of the target session carries an overload tag.
Step S104, adding the target fragments to the streaming task of the target session and processing the streaming task of the target session when the streaming task of the target session does not carry the overload tag.
Specifically, when the number of session threads is not full, the interface of the server receives a request of a slice, and under the condition that the query is not the request of the first slice, that is, the request of the slice of the non-established session, the existing streaming task is queried, and because the number of session threads is not full, the streaming task of the session does not carry an overload tag, and the streaming task of the session can be analyzed and processed. Therefore, all requests in the session when the session thread number is full are ensured, and the situation of active packet loss of the fragments of the streaming task which are created under the condition of not overload is avoided.
According to the message processing method, the processing request of the target fragments is received, wherein the target fragments are any fragments in the target session; inquiring whether a streaming task of a target session exists in a task stream to be handled, wherein the streaming task of the target session is established based on a processing request of any one fragment of the target session; judging whether the streaming task of the target session carries an overload tag or not under the condition of existence; under the condition that the streaming task of the target session does not carry an overload tag, adding the target fragment into the streaming task of the target session, and processing the streaming task of the target session, the problem of massive packet loss under the condition of overload flow when the streaming task is completed by adopting the HTTP protocol in the related technology is solved. And further achieves the effect of reducing packet loss under the condition of overload flow.
In the message processing method provided in the embodiment of the present application, optionally, when the streaming task of the target session does not carry the overload tag, adding the target fragment to the streaming task of the target session, and processing the streaming task of the target session includes: judging whether the number of the existing processing requests of the fragments is greater than or equal to the number of the overload threads of the requests; adding the target fragments into the streaming tasks of the target session under the condition that the number of the existing processing requests of the fragments is greater than or equal to the number of the overload threads of the requests, and performing first processing on the streaming tasks of the target session; and adding the target fragments into the streaming tasks of the target session under the condition that the number of processing requests of the existing fragments is smaller than the number of the overload threads, and performing second processing on the streaming tasks of the target session.
It should be noted that, in addition to limiting the session dimension, the number of session overload threads is set, and the request needs to be limited, so that the number of request overload threads is set.
Specifically, the number of overload threads of the request can be set to be larger than the number of overload threads of the session, and when the streaming task of the session does not carry an overload tag and the request is not overloaded, the fragmented request is processed. However, since the processing requirement of the fragments is greater than the creation requirement of the streaming task of the session, the situation that the streaming task of the session does not carry an overload tag, but the request is overloaded, at this time, the request processing thread needs to be released by waiting for other requests, and then the fragments are further processed.
Optionally, in the message processing method provided in the embodiment of the present application, when the number of existing processing requests of the slices is greater than or equal to the number of overload threads of the request, adding the target slice to the streaming task of the target session, and performing first processing on the streaming task of the target session includes: judging whether an idle request processing thread exists in a preset time; under the condition that idle request processing threads exist in preset time, adding the target fragments into the streaming task of the target session; and discarding the target fragments under the condition that no idle request processing thread exists within the preset time, and releasing the session processing threads occupied by the streaming tasks of the target session and the request processing threads occupied by the fragments in the streaming tasks of the target session.
Specifically, in the event of a request overload, other requesting threads will be waiting to release resources. If the request thread is not released before the time-out of the slice, the request of the slice will fail in time-out, the slice is discarded, the session will fail in time-out, the session thread occupied by the session is released, and the occupied request threads of other slices of the session are released. If the operation of releasing the request thread occurs before the time-out of the fragments, the idle request thread exists, and the processing of the streaming task of the session is normally performed.
Optionally, in the message processing method provided in the embodiment of the present application, when the number of existing processing requests of the slice is smaller than the number of overload threads of the request, adding the target slice to the streaming task of the target session, and performing second processing on the streaming task of the target session includes: adding the target fragments into the streaming task of the target session; judging whether the fragments existing in the streaming task of the target session are equal to the fragments contained in the target session or not; and executing the step of analyzing and processing the target session in the case that the fragments existing in the streaming task of the target session are equal to the fragments contained in the target session.
In addition, since fragments arrive out of order, when all fragments of a session arrive, the session is analyzed, and when there is a fragment that does not arrive in the session, the session is processed after waiting for all fragments that do not arrive.
For example, the task processing scenario is a sentence speech recognition, in which speech fragments are sequentially arranged in a case where all speech fragments of one speech arrive, speech recognition is performed, and in which waiting is performed in a case where one speech has an unreachable speech fragment.
Optionally, in the message processing method provided in the embodiment of the present application, after determining whether the streaming task of the target session carries an overload tag in the presence of the overload tag, the method further includes: and discarding the target fragments under the condition that the streaming task of the target session carries the overload label.
Specifically, under the condition that the streaming task of the target session carries an overload tag, the target session is not processed, the target fragment is discarded, and meanwhile, the target fragment does not occupy the request thread.
By the embodiment of the application, all requests in the session when the session threads are full can be ensured, and the situation of active packet loss of the fragments of the streaming task which are created under the condition of not overload is avoided. And meanwhile, when the requested thread is idle, the fragments are sent to the streaming task with the overload tag, and the streaming task with the overload tag is not processed any more. Therefore, the problems that the streaming task request with full threads is discarded, incomplete streaming task is built when the requested threads are idle, and the like are avoided, and the system can not normally process the service request gradually.
The embodiment of the application also provides a message processing system, and fig. 2 is a schematic diagram of the message processing system according to the embodiment of the application. As shown in fig. 2, the system includes: a client 21 and a server 22.
And the client 21 is configured to send a processing request of a target slice, where the target slice is any slice in the target session.
It should be noted that, the processing request of the target slice received by the server 22 may not be the first slice request, and the creation of the streaming task will be performed without the streaming task, whether the received request of the first slice is the first slice request or not. The first slicing request is not required to be sent by the client 21 with extra occupied resources, so that the waste of interface resources is avoided, and the influence of the out-of-order arrival of the slicing on the service is reduced.
The server 22 is configured to receive a processing request of a target fragment, and query whether a streaming task of a target session exists in a task stream to be handled, where the streaming task of the target session is established based on the processing request of any fragment of the target session; judging whether the streaming task of the target session carries an overload tag or not under the condition of existence; and adding the target fragments to the streaming task of the target session, processing the streaming task of the target session and sending the processing result to the client 21 when the streaming task of the target session does not carry the overload tag.
Specifically, when the number of session threads is not full, the interface of the server 22 receives a request of a slice, and if the query is not a request of a first slice, that is, if the query is not a request of a slice where a session is not created, the query is to query an existing streaming task, and since the number of session threads is not full, the streaming task of the session does not carry an overload tag, and the streaming task of the session can be analyzed and processed. Therefore, all requests in the session when the session thread number is full are ensured, and the situation of active packet loss of the fragments of the streaming task which are created under the condition of not overload is avoided.
The embodiment of the application also provides a message processing method, and fig. 3 is a flowchart of the message processing method according to the embodiment of the application. As shown in fig. 3, the method includes:
the client sends a request, i.e. a request to create a streaming task.
And under the condition that the server receives the request, judging whether the operation of creating the task or inquiring the task exists, and under the condition that the operation is locked and cannot be executed, after the lock is released, inquiring whether the streaming task exists, namely, whether the streaming task requested to be created exists.
And judging whether the flow is overloaded under the condition that the flow is not overloaded, creating the streaming task without marking overload labels under the condition that the flow is not overloaded, and creating the streaming task and marking overload labels under the condition that the flow is overloaded.
In addition, under the condition that the streaming task requested to be created exists, whether the streaming task has an overload tag is judged, under the condition that the streaming task does not have the overload tag, the streaming task is normally processed, a processing result is returned to the client, under the condition that the streaming task does not have the overload tag, and the unprocessed result is returned to the client.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
The embodiment of the application also provides a message processing device, and it should be noted that the message processing device of the embodiment of the application can be used for executing the message processing method provided by the embodiment of the application. The following describes a message processing apparatus provided in an embodiment of the present application.
Fig. 4 is a schematic diagram of a message processing apparatus according to an embodiment of the present application. As shown in fig. 4, the apparatus includes: the device comprises a receiving unit 10, a query unit 20, a first judging unit 30 and a processing unit 40.
Specifically, the receiving unit 10 is configured to receive a processing request of a target slice, where the target slice is any slice in the target session.
And the query unit 20 is configured to query whether a streaming task of the target session already exists in the task stream to be handled, where the streaming task of the target session is established based on a processing request of any one fragment of the target session.
A first judging unit 30, configured to judge whether the streaming task of the target session carries an overload tag if the streaming task exists.
And the processing unit 40 is configured to add the target fragment to the streaming task of the target session and process the streaming task of the target session if the streaming task of the target session does not carry the overload tag.
The message processing device provided by the embodiment of the application receives a processing request of a target fragment through a receiving unit 10, wherein the target fragment is any fragment in a target session; the query unit 20 queries whether a streaming task of a target session exists in the task stream to be handled, wherein the streaming task of the target session is established based on a processing request of any one fragment of the target session; the first judging unit 30 judges whether the streaming task of the target session carries an overload tag or not in the presence of the overload tag; the processing unit 40 adds the target fragment to the streaming task of the target session and processes the streaming task of the target session under the condition that the streaming task of the target session does not carry the overload tag, thereby solving the problem of a large amount of packet loss under the condition of overload of the traffic when the streaming task is completed by adopting the HTTP protocol in the related art, and further achieving the effect of reducing the packet loss under the condition of overload of the traffic.
Optionally, in the message processing apparatus provided in the embodiment of the present application, the apparatus further includes: the second judging unit is used for judging whether a target operation exists currently or not before inquiring whether a streaming task of the target session exists in the task stream to be handled, wherein the target operation comprises one of the following steps: querying the operation of the streaming task and creating the operation of the streaming task; and the execution unit is used for executing the step of inquiring whether the streaming task of the target session exists in the task stream to be handled under the condition that the target operation does not exist currently.
Optionally, in the message processing apparatus provided in the embodiment of the present application, the processing unit 40 includes: the judging module is used for judging whether the number of the existing processing requests of the fragments is greater than or equal to the number of the overload threads of the requests; the first processing module is used for processing the streaming task of the target session to perform first processing when the number of the existing processing requests of the fragments is greater than or equal to the number of the overload threads; and the second processing module is used for processing the streaming task of the target session to perform second processing under the condition that the number of the existing processing requests of the fragments is smaller than the number of the overload threads.
Optionally, in the message processing apparatus provided in the embodiment of the present application, the first processing module includes: the first judging submodule is used for judging whether an idle request processing thread exists in preset time; the first adding sub-module is used for adding the target fragments to the streaming task of the target session under the condition that idle request processing threads exist in preset time; and the release submodule is used for discarding the target fragments under the condition that no idle request processing thread exists in the preset time, and releasing the session processing threads occupied by the streaming tasks of the target session and the request processing threads occupied by the fragments in the streaming tasks of the target session.
Optionally, in the message processing apparatus provided in the embodiment of the present application, the second processing module includes: the second adding sub-module is used for adding the target fragments into the streaming task of the target session; the second judging submodule is used for judging whether the fragments existing in the streaming task of the target session are equal to the fragments contained in the target session or not; and the execution sub-module is used for executing the step of analyzing and processing the target session under the condition that the fragments existing in the streaming task of the target session are equal to the fragments contained in the target session.
Optionally, in the message processing apparatus provided in the embodiment of the present application, the apparatus further includes: the third judging unit is used for judging whether the number of the streaming tasks of the current session is greater than or equal to the number of the session overload threads under the condition that the streaming tasks of the current session do not exist after inquiring whether the streaming tasks of the target session exist in the task stream to be handled; the first creating unit is used for creating streaming tasks of the target session and creating overload labels for the streaming tasks of the target session under the condition that the number of streaming tasks of the current session is greater than or equal to the number of session overload threads; and the second creating unit is used for creating the streaming tasks of the target session which does not carry the overload label under the condition that the number of the streaming tasks of the current session is smaller than the number of the overload threads of the session.
Optionally, in the message processing apparatus provided in the embodiment of the present application, the apparatus further includes: and the discarding unit is used for discarding the target fragments when the streaming task of the target session carries the overload tag after judging whether the streaming task of the target session carries the overload tag in the presence.
The message processing apparatus includes a processor and a memory, the receiving unit 10, the first determining unit 30 of the inquiring unit 20, the processing unit 40, and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more than one kernel, and the problem of a large amount of packet loss under the condition of overload flow when the http protocol is adopted to finish the streaming task in the related technology is solved by adjusting the kernel parameters.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
The embodiment of the application also provides a nonvolatile storage medium, which comprises a stored program, wherein the program controls equipment where the nonvolatile storage medium is located to execute a message processing method when running.
The embodiment of the application also provides an electronic device, which comprises a processor and a memory; the memory has stored therein computer readable instructions for execution by the processor, wherein the computer readable instructions when executed perform a message processing method. The electronic device herein may be a server, a PC, a PAD, a mobile phone, etc.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that 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 one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.

Claims (8)

1. A method of message processing comprising:
the method comprises the steps that a server receives a processing request of a target fragment sent by a client, wherein the target fragment is any fragment in a target session;
inquiring whether a streaming task of the target session exists in a task stream to be handled, wherein the streaming task of the target session is established based on a processing request of any one fragment of the target session, and the server is used for processing the streaming task of the target session;
judging whether the streaming task of the target session carries an overload tag or not under the condition that the streaming task exists, wherein the overload tag represents that the session thread number is full;
adding the target fragments to the streaming task of the target session and processing the streaming task of the target session under the condition that the streaming task of the target session does not carry the overload tag;
if the streaming task of the target session does not carry the overload tag, adding the target fragment to the streaming task of the target session, and processing the streaming task of the target session includes:
judging whether the number of the existing processing requests of the fragments is greater than or equal to the number of the overload threads of the requests;
Processing the streaming task of the target session to perform first processing under the condition that the number of processing requests of the existing fragments is greater than or equal to the number of the overload threads of the requests;
processing the streaming task of the target session for a second processing in the case that the number of processing requests of the existing fragments is smaller than the number of the overload threads of the requests;
when the number of processing requests of the existing fragments is greater than or equal to the number of overload threads of the requests, processing the streaming task of the target session includes:
judging whether an idle request processing thread exists in a preset time;
adding the target fragments to the streaming task of the target session under the condition that the idle request processing thread exists in the preset time;
and discarding the target fragments under the condition that the idle request processing threads do not exist within the preset time, and releasing the session processing threads occupied by the streaming tasks of the target session and the request processing threads occupied by the fragments in the streaming tasks of the target session.
2. The method of claim 1, wherein prior to querying whether the streaming task of the target session already exists in the to-do task stream, the method further comprises:
Determining whether a target operation currently exists, wherein the target operation comprises one of the following: querying the operation of the streaming task and creating the operation of the streaming task;
and executing the step of inquiring whether the streaming task of the target session exists in the task flow to be handled or not under the condition that the target operation does not exist currently.
3. The method of claim 1, wherein processing the streaming task of the target session for a second process if the number of processing requests for the existing shards is less than the number of request overload threads comprises:
adding the target fragments to the streaming task of the target session;
judging whether the fragments existing in the streaming task of the target session are equal to the fragments contained in the target session or not;
and executing analysis processing of the target session under the condition that the fragments existing in the streaming task of the target session are equal to the fragments contained in the target session.
4. The method of claim 1, wherein after querying whether the streaming task of the target session already exists in the to-do task stream, the method further comprises:
Judging whether the number of streaming tasks of the current session is greater than or equal to the number of session overload threads or not under the condition that the current session does not exist;
creating streaming tasks of the target session and creating the overload labels for the streaming tasks of the target session under the condition that the number of streaming tasks of the current existing session is greater than or equal to the number of the session overload threads;
and in the case that the number of streaming tasks of the current existing session is smaller than the number of session overload threads, creating streaming tasks of the target session which do not carry the overload tag.
5. The method of claim 1, wherein after determining if the streaming task of the target session carries an overload tag if present, the method further comprises:
and discarding the target fragments under the condition that the streaming task of the target session carries the overload tag.
6. A message processing system, comprising:
the client is used for sending a processing request of the target fragments, wherein the target fragments are any fragments in the target session;
the server side is used for receiving the processing request of the target fragment and inquiring whether the streaming task of the target session exists in the task stream to be handled; judging whether the streaming task of the target session carries an overload tag or not under the condition of existence; adding the target fragment to the streaming task of the target session under the condition that the streaming task of the target session does not carry the overload tag, processing the streaming task of the target session, and sending a processing result to the client, wherein the overload tag represents that the number of session threads is full;
The method for processing the streaming task of the target session includes the steps of:
judging whether the number of the existing processing requests of the fragments is greater than or equal to the number of the overload threads of the requests;
processing the streaming task of the target session to perform first processing under the condition that the number of processing requests of the existing fragments is greater than or equal to the number of the overload threads of the requests;
processing the streaming task of the target session for a second processing in the case that the number of processing requests of the existing fragments is smaller than the number of the overload threads of the requests;
when the number of processing requests of the existing fragments is greater than or equal to the number of overload threads of the requests, processing the streaming task of the target session includes:
judging whether an idle request processing thread exists in a preset time;
adding the target fragments to the streaming task of the target session under the condition that the idle request processing thread exists in the preset time;
And discarding the target fragments under the condition that the idle request processing threads do not exist within the preset time, and releasing the session processing threads occupied by the streaming tasks of the target session and the request processing threads occupied by the fragments in the streaming tasks of the target session.
7. A message processing apparatus, comprising:
the receiving unit is used for receiving a processing request of a target fragment, wherein the target fragment is any fragment in a target session;
the query unit is used for querying whether the streaming task of the target session exists in the task stream to be handled, wherein the streaming task of the target session is established based on the processing request of any one fragment of the target session;
the first judging unit is used for judging whether the streaming task of the target session carries an overload tag or not under the condition that the streaming task exists, wherein the overload tag represents that the number of session threads is full;
the processing unit is used for adding the target fragments to the streaming task of the target session and processing the streaming task of the target session under the condition that the streaming task of the target session does not carry the overload tag;
The processing unit includes:
the judging module is used for judging whether the number of the existing processing requests of the fragments is greater than or equal to the number of the overload threads of the requests;
the first processing module is used for processing the streaming task of the target session to perform first processing when the number of the processing requests of the existing fragments is greater than or equal to the number of the overload threads of the requests;
the second processing module is used for processing the streaming task of the target session to perform second processing under the condition that the number of processing requests of the existing fragments is smaller than the number of the overload threads of the requests;
the first processing module includes:
the first judging submodule is used for judging whether an idle request processing thread exists in preset time;
the first adding submodule is used for adding the target fragments to the streaming task of the target session under the condition that the idle request processing thread exists in the preset time;
and the release submodule is used for discarding the target fragments under the condition that the idle request processing threads do not exist in the preset time, and releasing the session processing threads occupied by the streaming tasks of the target session and the request processing threads occupied by the fragments in the streaming tasks of the target session.
8. An electronic device comprising a processor and a memory, the memory having stored therein computer readable instructions for executing the computer readable instructions, wherein the computer readable instructions when executed perform the message processing method of any of claims 1 to 5.
CN202010761914.5A 2020-07-31 2020-07-31 Message processing method, system and device and electronic setting Active CN111885198B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010761914.5A CN111885198B (en) 2020-07-31 2020-07-31 Message processing method, system and device and electronic setting

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010761914.5A CN111885198B (en) 2020-07-31 2020-07-31 Message processing method, system and device and electronic setting

Publications (2)

Publication Number Publication Date
CN111885198A CN111885198A (en) 2020-11-03
CN111885198B true CN111885198B (en) 2023-07-11

Family

ID=73205020

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010761914.5A Active CN111885198B (en) 2020-07-31 2020-07-31 Message processing method, system and device and electronic setting

Country Status (1)

Country Link
CN (1) CN111885198B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1852100A (en) * 2005-07-22 2006-10-25 华为技术有限公司 Method for receiving-end to regroup data bag
CN1863158A (en) * 2005-10-31 2006-11-15 华为技术有限公司 IP message fragment cache memory and forwarding method
CN1941732A (en) * 2005-09-28 2007-04-04 北京大学 Method and device for classifying dynamic flow without IP partitioned regrouping
CN108683635A (en) * 2018-04-12 2018-10-19 国家计算机网络与信息安全管理中心 A kind of system and method for realizing the homologous chummage of IP fragmentation packet based on network processes chip

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7724776B2 (en) * 2007-10-30 2010-05-25 Telefonaktiebolaget L M Ericsson (Publ) Method and ingress node for handling fragmented datagrams in an IP network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1852100A (en) * 2005-07-22 2006-10-25 华为技术有限公司 Method for receiving-end to regroup data bag
CN1941732A (en) * 2005-09-28 2007-04-04 北京大学 Method and device for classifying dynamic flow without IP partitioned regrouping
CN1863158A (en) * 2005-10-31 2006-11-15 华为技术有限公司 IP message fragment cache memory and forwarding method
CN108683635A (en) * 2018-04-12 2018-10-19 国家计算机网络与信息安全管理中心 A kind of system and method for realizing the homologous chummage of IP fragmentation packet based on network processes chip

Also Published As

Publication number Publication date
CN111885198A (en) 2020-11-03

Similar Documents

Publication Publication Date Title
US20180213031A1 (en) System and method to balance servers based on server load status
CN107872396B (en) Communication method with timeout control, processing device, terminal device and server
CN111490947B (en) Data packet sending method, data packet receiving method, system, equipment and medium
CN106791957B (en) Video live broadcast processing method and device
CN111835682B (en) Connection control method, system, device and computer readable storage medium
CN108429703B (en) DHCP client-side online method and device
WO2021238259A1 (en) Data transmission method, apparatus and device, and computer-readable storage medium
CN111885198B (en) Message processing method, system and device and electronic setting
CN111698281B (en) Resource downloading method and device, electronic equipment and storage medium
CN112416594A (en) Micro-service distribution method, electronic equipment and computer storage medium
US8332498B2 (en) Synchronized relay messaging and coordinated network processing using SNMP
CN114138371B (en) Configuration dynamic loading method and device, computer equipment and storage medium
CN110351334B (en) Service request processing method and device and payment service request processing method and device
CN114338477B (en) Communication link monitoring method, device, equipment and storage medium
WO2018127013A1 (en) Method and device for concurrent transmission of stream data
CN106899652B (en) Method and device for pushing service processing result
CN113938296A (en) Network data access system and method
CN112769928B (en) Information interaction method and device based on service scene
US9479579B2 (en) Grouping processing method and system
CN108255820B (en) Method and device for data storage in distributed system and electronic equipment
CN114785675B (en) Method, device and storage medium for positioning service overtime
WO2022199306A1 (en) A method of processing an incoming service request by a first network function, nf, instance, as well as the corresponding network functions
CN110891247B (en) Method, system, equipment and medium for client stateless access cluster
CN114760209B (en) Data processing method, system, device and storage medium
WO2017076322A1 (en) Communication method and apparatus

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