A message processing method, apparatus, electronic device, and storage medium
By setting risk marks during message processing and using an exclusive thread pool to process the steps of having thread blocking probability, the thread blocking problem in the prior art caused by the failure of external resources to respond is solved, and the efficiency of message processing is improved.
Patent Information
- Application Number
- CN202111619528.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2041-12-27
AI Technical Summary
In the process of message processing, the idle threads are in a blocking state due to the failure of external resources during message processing, which seriously reduces the efficiency of message processing.
By receiving the target incoming message and obtaining the corresponding message processing scheme based on its message type, the risk mark is set on the basic processing steps with thread blocking probability, and when these steps are performed, an idle exclusive thread is called from the exclusive thread pool for processing.
It effectively avoids thread blockage caused by unresponsive external resources in traditional methods, and improves the efficiency of packet processing.
Smart Images

Figure CN114281506B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of resource scheduling, and in particular, to a message processing method, apparatus, electronic device, and storage medium. Background Art
[0002] Currently, in common financial systems, the implementation of some business requirements sometimes needs to interface with external systems. However, the message formats used in different systems generally vary during communication. Therefore, in order to achieve normal communication between different systems, it is usually necessary to perform message format conversion between different systems.
[0003] For example, in order to achieve mutual conversion between messages of different formats, when the server receives an incoming message from the client, the incoming message is placed in the execution queue, and then through the request dispatcher, an idle thread is obtained from the working thread pool, and finally, all message conversion processing logics of the incoming message are executed according to the idle thread, and corresponding message conversion responses are generated respectively.
[0004] However, when using the above message processing method, external resources need to be called during the process of calling an idle thread in the working thread pool to process the message. Once the external resources do not respond, the idle thread will wait until the external resources respond. In this way, if the external resources never respond, the idle thread will be blocked, and thus the message processing cannot continue for a long time.
[0005] Therefore, using the above message processing method will seriously reduce the efficiency of message processing. Summary of the Invention
[0006] Embodiments of this application provide a method, apparatus, electronic device, and storage medium to improve the efficiency of message processing.
[0007] In a first aspect, an embodiment of this application provides a message method, and the method includes:
[0008] Receiving a target incoming message, and obtaining a message processing solution set for the corresponding message type based on the message type of the target incoming message.
[0009] Based on the data processing types corresponding to the respective basic processing steps included in the message processing solution, setting a risk flag for the basic processing steps with a probability of thread blocking.
[0010] Execute each basic processing step in sequence to perform corresponding processing on the target incoming message. Among them, for each execution of a basic processing step: if a basic processing step is associated with a risk flag, call an idle dedicated thread from the dedicated thread pool to execute a basic processing step; if a basic processing step is not associated with a risk flag, call an idle working thread from the working thread pool to execute a basic processing step.
[0011] In a second aspect, an embodiment of the present application further provides a message processing device, and the device includes:
[0012] A receiving module, configured to receive a target incoming message, and obtain a message processing scheme set for the corresponding message type based on the message type of the target incoming message.
[0013] A marking module, configured to set a risk flag for a basic processing step with a thread blocking probability based on the data processing type corresponding to each basic processing step included in the message processing scheme.
[0014] An execution module, configured to execute each basic processing step in sequence to perform corresponding processing on the target incoming message. Among them, for each execution of a basic processing step: if a basic processing step is associated with a risk flag, call an idle dedicated thread from the dedicated thread pool to execute a basic processing step; if a basic processing step is not associated with a risk flag, call an idle working thread from the working thread pool to execute a basic processing step.
[0015] In an alternative embodiment, before receiving the target incoming message, the execution module is further configured to:
[0016] For a set historical period, obtain each processed historical message conversion service and its corresponding service processing record.
[0017] For each historical message conversion service, perform the following operations respectively: based on the service processing record corresponding to a historical message conversion service, determine the message type of a processed historical message, and the corresponding at least one basic processing step.
[0018] For each obtained message type, perform the following operations respectively: summarize the respective basic processing steps corresponding to a message type in different service processing records to obtain a message processing scheme corresponding to a message type.
[0019] In an alternative embodiment, when summarizing the respective basic processing steps corresponding to a message type in different service processing records to obtain a message processing scheme corresponding to a message type, the execution module is specifically configured to:
[0020] Deduplicate the respective basic processing steps based on the identification information corresponding to each basic processing step.
[0021] Based on the execution time corresponding to each basic processing step, determine the execution priority corresponding to each deduplicated basic processing step.
[0022] Sort the deduplicated basic processing steps according to each execution priority to obtain the message processing solution corresponding to the one message type.
[0023] In an alternative embodiment, when setting a risk flag for a basic processing step with a thread blocking probability based on the data processing type corresponding to each basic processing step included in the message processing solution, the flagging module is specifically configured to:
[0024] For each basic processing step included in the message processing solution, respectively perform the following operations:
[0025] Obtain the data processing type of a basic processing step; wherein, the data processing type is input / output (IO) type or non-IO type.
[0026] When determining that the data processing type of a basic processing step is the IO type, determine that a basic processing step has a thread blocking probability and set a risk flag for the corresponding basic processing step.
[0027] In an alternative embodiment, during the process of sequentially executing each basic processing step to perform corresponding processing on the target incoming message, the execution module is further configured to:
[0028] Query the message processing status of the target incoming message based on the set status query period.
[0029] If the message processing status is an abnormal status, stop the message processing of the target incoming message and generate a corresponding message conversion response.
[0030] Send the message conversion response to the corresponding target terminal.
[0031] In an alternative embodiment, during the process of sequentially executing each basic processing step to perform corresponding processing on the target incoming message, the execution module is further configured to:
[0032] Generate corresponding message conversion information based on the message processing result of the current basic processing step; wherein, the message conversion information is step processing successful or step processing failed;
[0033] If the message conversion information is step processing failed, end the message processing of the target incoming message and send the message conversion information to the corresponding target terminal.
[0034] If the message conversion information indicates that the step processing fails, continue with the message processing of the target incoming message.
[0035] In a third aspect, an electronic device is provided, which includes:
[0036] A memory for storing computer instructions.
[0037] A processor for reading the computer instructions and executing the message processing method as described in the first aspect.
[0038] In a fourth aspect, a computer-readable storage medium is provided, which stores computer-executable instructions for causing a computer to execute the message processing method as described in the first aspect.
[0039] In a fifth aspect, a computer program product is provided, which, when called by a computer, causes the computer to execute the message processing method as described in the first aspect.
[0040] The message processing method provided by the embodiments of the present application determines the corresponding message processing scheme based on the message type of the received target incoming message, and then sets risk marks for the basic processing steps with a thread blocking probability based on the data processing types corresponding to the respective basic processing steps in the message processing scheme. Thus, when executing the basic processing steps associated with risk marks, an idle dedicated thread is called to execute the basic processing steps associated with risk marks. In this way, when executing the basic processing steps associated with risk marks, based on the risk marks set for the basic processing steps with a thread blocking probability, an idle dedicated thread is called from the dedicated thread pool to execute the basic processing steps associated with risk marks, avoiding the technical defect in the traditional method where the external resources do not respond all the time and the idle threads will be in a blocked state, and improving the efficiency of message processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 Exemplarily shows a schematic diagram of the system architecture applicable to the embodiments of the present application;
[0042] Figure 2 Exemplarily shows a schematic diagram of an asynchronous non-blocking processing framework provided by the embodiments of the present application;
[0043] Figure 3 Exemplarily shows a schematic diagram of the processing mechanism of a working thread pool provided by the embodiments of the present application;
[0044] Figure 4 Exemplarily shows a schematic diagram of the method flow of the generation process of a message processing scheme provided by the embodiments of the present application;
[0045] Figure 5Schematically shows a method flow diagram for screening historical message conversion services corresponding to a set historical period and their respective corresponding service processing records provided by an embodiment of the present application;
[0046] Figure 6 Schematically shows a method flow diagram for generating a message processing scheme corresponding to a message type provided by an embodiment of the present application;
[0047] Figure 7 Schematically shows an embodiment of the present application based on Figure 4 Logical schematic diagram;
[0048] Figure 8 Schematically shows a logical schematic diagram of a working thread calling each message conversion execution module provided by an embodiment of the present application;
[0049] Figure 9 Schematically shows a method flow diagram for a message processing method for a target incoming message provided by an embodiment of the present application;
[0050] Figure 10 Schematically shows a logical schematic diagram of setting a risk flag provided by an embodiment of the present application;
[0051] Figure 11 Schematically shows an embodiment of the present application based on Figure 9 Logical schematic diagram;
[0052] Figure 12 Schematically shows a structural schematic diagram of a message processing device provided by an embodiment of the present application;
[0053] Figure 13 Schematically shows a structural schematic diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0054] To improve the efficiency of message processing, in an embodiment of the present application, based on the message type of the received target incoming message, a corresponding message processing scheme is determined, and then based on the data processing types corresponding to the respective basic processing steps in the message processing scheme, a risk flag is set for the basic processing steps with a thread blocking probability, so that when executing the basic processing steps associated with the risk flag, an idle dedicated thread is called to execute the basic processing steps associated with the risk flag.
[0055] To better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are first described below.
[0056] (1) Synchronization: It means that after a request or call is sent, the program actively waits for the call result, and the program will not return until the call result is received.
[0057] (2) Asynchronous: It means that after a request or call is sent, the program does not need to wait for the call result and returns directly. The call result is returned separately in the form of a notification or callback.
[0058] (3) Blocking: When the current thread executes a call operation, it needs to wait for the operation to end before returning. When the call does not return a result, the thread stops executing other operations and only waits.
[0059] (4) Non-blocking: When the current thread executes a call operation, it does not need to wait for the operation to end and returns directly. When the call does not return a result, the thread can continue to execute other operations.
[0060] (5) WebFlux: A new reactive World Wide Web (Web) framework introduced in Spring Framework 5.0, which is fully asynchronous and non-blocking.
[0061] (6) WebClient: A reactive and non-blocking web request client provided in the WebFlux framework. The service allows Win32 applications to access documents on the Internet. This service extends the network capabilities of Windows; it allows standard Win32 applications to create, read, and write files on an Internet file server by using Web-based Distributed Authoring and Versioning (WebDAV) and communicate using the Hyper Text Transfer Protocol (HTTP).
[0062] (7) WebDAV: A file access protocol described by Extensible Markup Language (XML), a communication protocol based on the HTTP 1.1 protocol. It extends HTTP 1.1 and adds some new methods in addition to several HTTP standard methods such as GET, POST, and HEAD, enabling applications to directly read and write to a Web server, supporting file write locking and unlocking, and also supporting file version control.
[0063] (8) Netty: A Java open-source framework provided by JBOSS, now an independent project on Github, which provides an asynchronous and event-driven network application framework and tools for quickly developing high-performance and highly reliable network servers and client programs.
[0064] It should be noted that the above naming method of technical terms is only an example, and the embodiments of the present application do not limit the naming method of the above technical terms.
[0065] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0066] It should be noted that in the description of the present application, "a plurality of" is understood as "at least two". "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The connection between A and B can represent: A is directly connected to B and A is connected to B through C. In addition, in the description of the present application, words such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0067] Figure 1 An exemplary system architecture diagram applicable to the embodiments of the present application is shown, as Figure 1 shown. The system architecture includes: a server 101 and terminal devices (102a, 102b). Among them, information interaction can be carried out between the server 101 and the terminal devices (102a, 102b) through a wireless communication method or a wired communication method.
[0068] Exemplarily, the server 101 can access the network through cellular mobile communication technology, so as to communicate with the terminal devices (102a, 102b). The cellular mobile communication technology, for example, includes fifth-generation mobile communication (5th Generation Mobile Networks, 5G) technology.
[0069] Optionally, the server 101 can access the network through a short-range wireless communication method, so as to communicate with the terminal devices (102a, 102b). The short-range wireless communication method, for example, includes wireless fidelity (Wireless Fidelity, Wi-Fi) technology.
[0070] The embodiments of the present application do not limit the number of the server and the above other devices. Figure 1 Only one server is taken as an example for description.
[0071] Server 101 is configured to receive a target incoming message, obtain a message processing scheme set for the corresponding message type based on the message type of the target incoming message; set a risk flag for a basic processing step with a thread blocking probability based on the data processing type corresponding to each basic processing step included in the message processing scheme; sequentially execute each basic processing step to perform corresponding processing on the target incoming message. Wherein, for each execution of a basic processing step: if a basic processing step is associated with a risk flag, call an idle dedicated thread from the dedicated thread pool to execute the basic processing step; if a basic processing step is not associated with a risk flag, call an idle working thread from the working thread pool to execute the basic processing step.
[0072] It should be noted that in the embodiments of the present application, to solve the problems of synchronous blocking and low concurrency ability of the traditional message conversion system, an asynchronous non-blocking Input Output (IO) operation processing framework and a reactive programming framework are introduced in the server to improve the parallel processing ability of Server 101.
[0073] In the embodiments of the present application, taking Netty as an example of the IO processing framework, refer to Figure 2 As shown, the master-slave Reactor mode architecture of Netty includes: a request receiver 201, a master responder 202, a slave responder 203, and a working thread pool 204. Among them, the working thread pool includes at least two IO working threads (for example, IO working thread 1, IO working thread 2).
[0074] Under the master-slave Reatctor mode architecture of Netty, the processing process of the incoming message is as follows: Server 20 saves each incoming message sent by the client (21a, 21b, 21c) in the request receiver 201; then, through the request receiver 201, distributes each incoming message to the master responder 202; further, through the master responder 202, parses the network protocol of the incoming message, receives the incoming message and creates a socket, and then creates a corresponding channel based on the socket, so as to distribute the channel to the slave responder 203; and finally, through the slave responder 203, maintains the working thread pool and allocates the received channel containing the incoming message to an idle thread to perform message processing, where all IO operations (network reading and writing) are performed on the idle thread.
[0075] Refer to Figure 3 As shown, the processing mechanism within the working thread pool is as follows:
[0076] Inside each worker thread pool, there is a task selector responsible for scheduling tasks for execution and receiving task ready notification events. The tasks to be executed can be divided into IO tasks and non-IO tasks. The ready task queue stores tasks in a ready state that can be immediately executed. For example, a message processing service that has already prepared to read data. The waiting task queue stores tasks in a waiting state that cannot be immediately executed. For example, a message processing service that has not yet received a ready notification for reading data. If a task that needs to wait for a ready notification is received, it will be placed in the waiting task queue; otherwise, it will be placed in the ready task queue. The task selector continuously queries the ready task queue. If there are tasks in a ready state, it schedules them to be executed on an idle thread in the worker thread pool. If a ready notification for a task in the waiting task queue is received, the corresponding task is transferred to the ready task queue.
[0077] Based on the above processing mechanism, in the worker thread pool, the task selector always selects ready tasks that do not need to block and wait for processing. If a task is not ready, it will not be scheduled, and the CPU resources freed up at this time can be used for other tasks in a ready state. It should be noted that the total number of IO worker threads is limited, usually set to twice the number of CPU cores. Each IO worker thread can contain more than one channel, thus achieving concurrent processing of incoming messages and making full use of thread resources as a whole.
[0078] In addition, taking the Spring WebFlux framework as an example of a reactive programming framework, the Spring WebFlux framework defines a set of data flow processing processes, and the data processing results are encapsulated into signals using Mono or Flux objects for publication.
[0079] During the processing, Mono or Flux will emit three signal values, including element values, error signals, and completion signals. Among them, the element value is the target output of the data processing process, the completion signal notifies the client that the data processing process has ended, and the error signal will terminate the data processing process and pass the error information to the client, so that after the client asynchronously receives the signal, it can perform business processing.
[0080] It should be noted that the Spring WebFlux framework is an application programming framework built on top of a non-blocking IO processing framework, encapsulating the event notifications generated by non-blocking IO processing into signals.
[0081] In the embodiment of the present application, a message conversion system is deployed on the server. The underlying layer of the message conversion system is based on the non-blocking IO framework Netty to implement the access and outgoing of message processing. The upper-layer application logic is built based on the Spring WebFlux framework. Through the asynchronous reactive programming interface, the asynchronous non-blocking request processing effect is achieved. The message conversion system routes the received message conversion request to a specific logic controller for processing; parses the request message format and constructs a target outgoing call object; uses the WebClient client of the Spring WebFlux network framework, based on asynchronous reactive programming, uses Netty to implement remote message calls, communicates with the server through the data stream method, and the overall framework implementation is asynchronous non-blocking and based on reactive callback processing.
[0082] Specifically, the control layer of the message conversion system receives external requests, obtains incoming messages, and distributes them to the corresponding message conversion layer for subsequent conversion; then, parses the external message, performs message format conversion, converts the external request message format into an internal message format recognizable by the backend business system, and performs some normative and security processing; furthermore, uses WebClient to implement remote calls and reuses the event loop thread pool of Netty for concurrent calls. This call is implemented based on asynchronous non-blocking IO technology. The calling thread does not need to wait for the call result to return, so the same thread can concurrently execute multiple remote calls, and the call results will be handed over to other threads for processing after they are ready; further, after the remote call receives the response returned by other systems in the background, it parses and processes the message format and security, and performs subsequent business logic processing; finally, returns a response in the corresponding message format to the client, and the external request processing ends.
[0083] The terminal devices (102a, 102b) are devices that can provide voice and / or data connectivity to users, including handheld terminal devices with wireless connection functions, in-vehicle terminal devices, etc.
[0084] Exemplarily, the terminal device can be: a mobile phone, a tablet computer, a laptop computer, a handheld computer, a Mobile Internet Device (MID), a wearable device, a Virtual Reality (VR) device, an Augmented Reality (AR) device, a wireless terminal device in industrial control, a wireless terminal device in unmanned driving, a wireless terminal device in a smart grid, a wireless terminal device in transportation safety, a wireless terminal device in a smart city, or a wireless terminal device in a smart home, etc.
[0085] Furthermore, based on the above system architecture, obtain the message processing solutions corresponding to each message type within a set historical period, refer toFigure 4 As shown in the figure, in the embodiment of the present application, the generation process of a message processing scheme is as follows:
[0086] S401: For a set historical period, obtain each processed historical message conversion service and its corresponding service processing record.
[0087] Specifically, when executing step S401, the server can, based on the set historical period, respectively screen out from the original database each historical message conversion service that meets the set historical period and its corresponding service processing record recorded by the storage device.
[0088] Exemplarily, refer to Figure 5 As shown in the figure, each historical message conversion service recorded in the original database and its corresponding service processing record have corresponding time identifiers. Based on the set historical period, the server screens out from each historical message conversion service and its corresponding service processing record the historical message conversion service corresponding to the set historical period and its corresponding service processing record. Taking 4 historical message conversion services and their corresponding service processing records as an example, the time identifiers corresponding to each historical message conversion service and its corresponding service processing record are shown in Table 1:
[0089] Table 1
[0090] Message Conversion Service Message Conversion Service 1 Message Conversion Service 2 Message Conversion Service 3 Message Conversion Service 4 Service Processing Record Service Processing Record 1 Service Processing Record 2 Service Processing Record 3 Service Processing Record 4 Time Identifier M.T1 M.T2 M.T3 M.T4
[0091] It can be seen from the above table that the server can determine the corresponding service processing time range according to the time identifiers corresponding to each historical message conversion service and its corresponding service processing record. For example, taking message conversion service 1 and service processing record 1 as an example, the server can obtain the service processing time corresponding to the time identifier M.T1, and so on.
[0092] Furthermore, the server is based on the set historical period T W , if the set historical period T W includes the service processing time range F.T1 corresponding to M.T1 and the service processing time range F.T4 corresponding to M.T4, then message conversion service 1 and service processing record 1, as well as message conversion service 4 and service processing record 4, can be used as each processed historical message conversion service and its corresponding service processing record within the set historical period.
[0093] S402: After obtaining each processed historical message conversion service and its corresponding service processing record, for each historical message conversion service, perform the following operations respectively: Based on the service processing record corresponding to a historical message conversion service, determine the message type of a processed historical message and the corresponding at least one basic processing step.
[0094] Specifically, when executing step S402, the server, based on the service processing record corresponding to a historical message conversion service and in combination with the corresponding message type detection algorithm, obtains the message type of the historical message corresponding to this historical message conversion service, and determines each basic processing step of the historical message corresponding to this historical message conversion service according to the preset basic processing step extraction algorithm.
[0095] Exemplarily, still taking service processing record 1 in Table 1 as an example, the server can, based on the message type detection algorithm, obtain the message type of the corresponding historical message included in service processing record 1, for example, type A message; and based on the basic processing step extraction algorithm, determine 3 basic processing steps of the corresponding historical message included in service processing record 1, namely, Step.Pb.1, Step.Pb.2, Step.Pb.3.
[0096] S403: After performing corresponding operations for each historical message conversion service respectively, for each obtained message type, perform the following operations respectively: Aggregate the respective basic processing steps corresponding to a message type in different service processing records to obtain a message processing scheme corresponding to the message type.
[0097] In a possible implementation manner, when executing step S403, the server performs deduplication processing on each basic processing step based on the identification information corresponding to each basic processing step corresponding to a message type, then sorts the deduplicated basic processing steps based on their respective corresponding execution priorities, and finally obtains the message processing scheme corresponding to this message type. Refer to Figure 6 As shown, in the embodiment of the present application, the specific steps for generating a message processing scheme corresponding to a message type are as follows:
[0098] S4031: Perform deduplication processing on each basic processing step based on the identification information corresponding to each basic processing step.
[0099] Specifically, when executing step S4031, the server may, based on the message type of the historical message, obtain at least one service processing record from each historical message conversion service and its respective corresponding service processing record, and obtain each basic processing step corresponding to each of the at least one service processing record, so as to perform deduplication processing according to the identification information corresponding to each basic processing step, that is, if there are basic processing steps with the same identification information, arbitrarily select one of them as the basic processing step corresponding to this message type.
[0100] Exemplarily, if the message type of the historical message corresponds to 3 basic processing steps with the same identification information in different service processing records, that is, S.T.1, S.T.2, and S.T.3, then arbitrarily select one of S.T.1, S.T.2, and S.T.3 as the basic processing step corresponding to this message type. For example, take S.T.2 as the basic processing step corresponding to this message type.
[0101] S4032: After performing deduplication processing on each basic processing step, determine the execution priority corresponding to each deduplicated basic processing step based on the execution time corresponding to each basic processing step.
[0102] Specifically, when executing step S4032, after the server performs deduplication processing on each basic processing step, it may determine the execution time of the corresponding basic processing step based on the execution information corresponding to each basic processing step, and then determine the execution priority of the corresponding basic processing step based on the sequence attribute of the execution time corresponding to each deduplicated basic processing step.
[0103] Exemplarily, taking the case where the historical message corresponds to 4 deduplicated basic processing steps as an example, the server obtains the execution time corresponding to each deduplicated basic processing step from the execution information corresponding to each deduplicated basic processing step according to the characteristic information of the execution time, and then determines the execution priority corresponding to each deduplicated basic processing step. The execution time and execution priority corresponding to each deduplicated basic processing step are shown in Table 2:
[0104] Table 2
[0105]
[0106] As can be seen from the above table, based on the sequence of the execution time corresponding to the 4 deduplicated basic processing steps: Step.Pb.Q1, Step.Pb.Q2, Step.Pb.Q3, Step.Pb.Q4, the server can obtain the corresponding execution priorities in sequence: 2th, 4th, 3th, 1th.
[0107] S4033: After determining the execution priorities corresponding to each of the deduplicated basic processing steps, sort the deduplicated basic processing steps according to each execution priority to obtain a message processing scheme corresponding to a message type.
[0108] Specifically, when executing step S4033, the server sorts the deduplicated basic processing steps based on the execution priorities corresponding to each of the obtained deduplicated basic processing steps, and then uses the deduplicated basic processing steps after priority sorting as the message processing scheme corresponding to this message type.
[0109] Exemplarily, still taking the 4 deduplicated basic processing steps in Table 2 as an example, the server can determine that the execution order of the 4 deduplicated basic processing steps corresponding to the message processing scheme corresponding to the message type is as follows: Step.Pb.Q4, Step.Pb.Q1, Step.Pb.Q3, Step.Pb.Q2, based on the execution priorities corresponding to each of the 4 deduplicated basic processing steps.
[0110] Figure 7 Exemplarily shows a schematic flowchart of a method for generating a message processing scheme, as Figure 7 shown, the server can obtain various historical message conversion services within a set historical period, respectively obtain the corresponding service processing records from each historical message conversion service, further obtain the message types and basic processing steps of the historical messages in each service processing record, and finally perform summary deduplication or filtering processing to generate the message processing schemes corresponding to each message type.
[0111] Exemplarily, taking 4 types of message processing schemes as an example, the respective message processing schemes and their corresponding sets of processing steps are shown in Table 3, where each set of processing steps includes: at least one basic processing step.
[0112] Table 3
[0113] Solution Number Message Type Message Processing Solution Set of Processing Steps P.B.1 Class A Mess.Pro.Sch.1 Step.M.1 P.B.2 Class B Mess.Pro.Sch.2 Step.M.2 P.B.3 Class C Mess.Pro.Sch.3 Step.M.3 P.B.4 Class D Mess.Pro.Sch.4 Step.M.4
[0114] It should be noted that the basic processing steps corresponding to each message processing scheme are respectively used for message conversion processing in the corresponding message conversion execution modules of the message conversion system. According to the business content completed by each message conversion execution module, they are divided into: a parsing and distribution module, a security processing module, a format conversion module, an outbound call module, a flow control module, and an error handling module. The names of the above-mentioned execution modules are not restricted in any way. Among them, when the security processing module and the outbound call module execute relevant basic processing steps, they involve IO operations.
[0115] Figure 8Exemplarily shown is a logical schematic diagram of a working thread calling each message conversion execution module provided by an embodiment of the present application. As Figure 8 shown, when the server executes a historical incoming message conversion service, it obtains each service requirement from the service attributes corresponding to the historical incoming message conversion service, calls the message conversion execution modules set for the corresponding service requirements, and finally selects the basic processing steps corresponding to the respective service requirements based on the correspondence between the target identifiers and the basic processing steps corresponding to each service requirement.
[0116] It should be noted that the server can determine the call paths and call sequences of the above-mentioned modules during the message conversion process based on information such as the message conversion service ID, security policy ID, and background service interface definition included in the incoming message sent by the client.
[0117] The embodiment of the present application does not limit the number of each message conversion execution module. Figure 8 Only one example of each message conversion execution module is used for description.
[0118] The parsing and distribution module is used to parse the incoming message initiated by the client according to the request message format, so as to determine the message type and the service ID of the corresponding backend, determine the next forwarding path, and needs to establish a connection with the client.
[0119] The security processing module is used to decrypt and read the encrypted data part in the content of the incoming message initiated by the client, or encrypt the data that needs to be encrypted for transmission, and also undertakes the signature or verification of the data digest.
[0120] The format conversion module is used to convert the content of the incoming message initiated by the client according to the interface format of the backend business system, or convert the content of the response from the backend business system according to the client interface format.
[0121] The outbound call module is used to undertake the functions of sending and receiving network requests to the backend business system, involving network IO operations. This module generates a basic processing step of response readiness after receiving the response for the outbound call.
[0122] The flow control module is used to record the number of message conversion services that have not been completed for the currently connected clients. If this number exceeds the preset threshold upper limit, it directly rejects the new incoming messages from continuing to access, and can generate a release or rejection of the incoming messages according to its own logic.
[0123] An error handling module is used to uniformly generate an internal error signal if any unexpected error or exception occurs during the execution process. This error signal is uniformly processed by the error handling module. The specific handling measures include constructing response information, recording error logs, etc. After the processing is completed, the server can continue with the message conversion.
[0124] To avoid the occurrence of blocking during IO operations, for the security processing module and the outbound call module, in the embodiments of the present application, a dedicated thread pool is configured for the module where the corresponding basic processing steps are located, and the entire module is scheduled to execute in the blocking thread pool. This ensures that the working thread pool can always be in a non-blocking state and continuously perform message conversion.
[0125] Further, based on the above preprocessing operations, message processing schemes corresponding to each message type are obtained. Refer to Figure 9 As shown, in the embodiments of the present application, for the message processing method of the target incoming message, the specific steps are as follows:
[0126] S901: Receive the target incoming message, and based on the message type of the target incoming message, obtain the message processing scheme set for the corresponding message type.
[0127] Specifically, when executing step S901, the server receives the target incoming message, parses the target incoming message to obtain the message type corresponding to the target incoming message, and then based on the correspondence between the message type and the message processing scheme, filters out the message processing scheme corresponding to the message type of the target incoming message from each message processing scheme.
[0128] Exemplarily, refer to Figure 7 As shown, if the message type of the target incoming message is message type 2, the server can match message type 2 from the mapping relationship between the message type and the message processing scheme, so as to determine that the message processing scheme corresponding to message type 2 is message processing scheme 2.
[0129] S902: After obtaining the message processing scheme set for the corresponding message type, based on the data processing type corresponding to each basic processing step included in the message processing scheme, set a risk mark for the basic processing steps with a thread blocking probability.
[0130] In a possible implementation manner, when executing S902S, refer to Figure 10As shown in the figure, after the server obtains the message processing scheme corresponding to the target incoming message, for each basic processing step included in the message processing scheme, the following operations are respectively performed: Obtain the data processing type of a basic processing step. When it is determined that the data processing type of this basic processing step is the IO type, it is determined that this basic processing step has a thread blocking probability, and a risk flag or a high-risk flag is set for this basic processing step; when it is determined that the data processing type of this basic processing step is a non-IO type, it is determined that this basic processing step does not have a thread blocking probability, and a risk flag is not set or a low-risk flag is set for this basic processing step. Among them, the data processing type can be divided into two categories: the IO type and the non-IO type.
[0131] Exemplarily, assume that the message processing scheme corresponding to the target incoming message includes the above 4 deduplicated basic processing steps in Table 2, that is, Step.Pb.Q1, Step.Pb.Q2, Step.Pb.Q3, Step.Pb.Q4, and the 4 deduplicated basic processing steps are executed in the parsing and distribution module, the flow control module, the security processing module, and the format conversion module in sequence, and the execution order is: Step.Pb.Q4, Step.Pb.Q1, Step.Pb.Q3, Step.Pb.Q2. Among them, Step.Pb.Q2 is executed in the flow control module, and Step.Pb.Q3 is executed in the security processing module, then risk flags need to be set for Step.Pb.Q2 and Step.Pb.Q3 respectively. Step.Pb.Q1 is executed in the parsing and distribution module, and Step.Pb.Q4 is executed in the format conversion module, then risk flags do not need to be set for Step.Pb.Q1 and Step.Pb.Q4 respectively. Among them, the risk flag can be a risk identifier or a risk level, and no restrictions are made here.
[0132] S903: After setting the risk flag for the basic processing step with the thread blocking probability, each basic processing step is executed in sequence to perform corresponding processing on the target incoming message. Among them, when each basic processing step is executed: If a basic processing step is associated with a risk flag, an idle dedicated thread is called from the dedicated thread pool to execute a basic processing step; if a basic processing step is not associated with a risk flag, an idle working thread is called from the working thread pool to execute a basic processing step.
[0133] Specifically, when executing step S903, the server determines which thread resources in which thread pool to call to complete the current basic processing step based on the judgment of whether the current basic processing step is associated with a risk flag. If the current basic processing step is associated with a risk flag, an idle dedicated thread is called from the dedicated thread pool to execute the current basic processing step; if the current basic processing step is not associated with a risk flag, an idle working thread is called from the working thread pool to execute the current basic processing step.
[0134] Exemplarily, if the current basic processing step is Step.Pb.Q2, and it is easy to know that Step.Pb.Q2 needs to be executed in the flow control module, the risk flag set by Step.Pb.Q2 can be obtained, and thus, based on the risk flag set by Step.Pb.Q2, an idle dedicated thread is called from the dedicated thread pool to execute Step.Pb.Q2; if the current basic processing step is Step.Pb.Q1, and it is easy to know that Step.Pb.Q1 needs to be executed in the parsing and distribution module and no risk flag is set for Step.Pb.Q1, then only an idle working thread needs to be called from the working thread pool to execute Step.Pb.Q1.
[0135] Optionally, the server can preset the corresponding relationship between various basic processing steps and thread pool calls within a set historical period. After receiving the target incoming message, it is only necessary to determine which idle thread in which thread pool to call to execute the corresponding basic processing step according to each basic processing step included in the corresponding message conversion scheme.
[0136] In a preferred implementation manner, when executing step S903, the server can query the message processing status of the target incoming message on time based on a set status query period. If the message processing status is an abnormal status, the message processing of the target incoming message is stopped, a corresponding message conversion response is generated, and the message conversion response is sent to the corresponding target terminal. Among them, the message conversion processing status is obtained by an idle working thread executing a basic processing step not associated with a risk flag, or an idle dedicated thread executing a corresponding basic processing step associated with a risk flag.
[0137] In a preferred implementation manner, when executing step S903, the server generates two types of notification messages, namely step processing failure or step processing success, for each executed basic processing step. If a notification message of step processing failure is generated, the message processing of the target incoming message is stopped, a corresponding message conversion message is generated, and the message conversion message is sent to the corresponding target terminal.
[0138] Figure 11 Exemplarily shows a logical schematic diagram of a message processing method for a target incoming message provided by an embodiment of the present application, asFigure 11 As shown, the server can obtain the message conversion scheme set corresponding to the message type of the target incoming message, and based on whether each basic processing step included in the message conversion scheme has a thread blocking probability, determine whether to set a risk mark for the corresponding basic processing step. When sequentially executing each basic processing step included in the message conversion scheme, if a basic processing step without an associated risk mark is encountered, an idle exclusive thread in the exclusive thread pool is called to execute the basic processing step; if a basic processing step without an associated risk mark is encountered, an idle working thread in the working thread pool is called to execute the basic processing step.
[0139] The message processing method provided by the embodiment of the present application determines the corresponding message processing scheme based on the message type of the received target incoming message, and then sets a risk mark for the basic processing step with a thread blocking probability based on the data processing type corresponding to each basic processing step in the message processing scheme, so that when executing the basic processing step associated with the risk mark, an idle exclusive thread is called to execute the basic processing step associated with the risk mark. In this way, when executing the basic processing step associated with the risk mark, based on the risk mark set for the basic processing step with a thread blocking probability, an idle exclusive thread is called from the exclusive thread pool to execute the basic processing step associated with the risk mark, avoiding the technical defect that in the traditional method, when external resources do not respond all the time, the idle thread will be in a blocked state, and improving the efficiency of message processing.
[0140] Based on the same technical concept, the embodiment of the present application also provides a message processing device, which can implement the above method flow of the embodiment of the present application.
[0141] Figure 12 Exemplarily shows a schematic structural diagram of a message processing device provided by the embodiment of the present application. As Figure 12 shown, the message processing device includes: a receiving module 1201, a marking module 1202, and an execution 1203, where:
[0142] The receiving module 1201 is configured to receive a target incoming message, and obtain a message processing scheme set corresponding to the message type based on the message type of the target incoming message.
[0143] The marking module 1202 is configured to set a risk mark for the basic processing step with a thread blocking probability based on the data processing type corresponding to each basic processing step included in the message processing scheme.
[0144] An execution module 1203, configured to sequentially execute each basic processing step to perform corresponding processing on a target incoming message. Wherein, for each executed basic processing step: if a basic processing step is associated with a risk flag, then call an idle dedicated thread from a dedicated thread pool to execute a basic processing step; if a basic processing step is not associated with a risk flag, then call an idle working thread from a working thread pool to execute a basic processing step.
[0145] In an alternative embodiment, before receiving the target incoming message, the execution module 1203 is further configured to:
[0146] For a set historical period, obtain each processed historical message conversion service and its corresponding service processing record.
[0147] For each historical message conversion service, perform the following operations respectively: based on the service processing record corresponding to a historical message conversion service, determine the message type of a processed historical message and the corresponding at least one basic processing step.
[0148] For each obtained message type, perform the following operations respectively: summarize the respective basic processing steps corresponding to a message type in different service processing records to obtain a message processing scheme corresponding to a message type.
[0149] In an alternative embodiment, when summarizing the respective basic processing steps corresponding to a message type in different service processing records to obtain a message processing scheme corresponding to a message type, the execution module 1203 is specifically configured to:
[0150] Based on the identification information corresponding to each basic processing step, perform deduplication processing on the basic processing steps.
[0151] Based on the execution time corresponding to each basic processing step, determine the execution priority corresponding to each deduplicated basic processing step.
[0152] Sort the deduplicated basic processing steps according to each execution priority to obtain the message processing scheme corresponding to a message type.
[0153] In an alternative embodiment, when setting a risk flag for a basic processing step with a thread blocking probability based on the data processing type corresponding to each basic processing step included in the message processing scheme, the marking module 1202 is specifically configured to:
[0154] For each basic processing step included in the message processing scheme, perform the following operations respectively:
[0155] Obtain the data processing type of a basic processing step; wherein, the data processing type is input / output (IO) type or non-IO type.
[0156] When determining that the data processing type of a basic processing step is the IO type, determine that a basic processing step has a thread blocking probability, and set a risk flag corresponding to a basic processing step.
[0157] In an alternative embodiment, during the process of sequentially executing each basic processing step to perform corresponding processing on the target incoming message, the execution module 1203 is further configured to:
[0158] Query the message processing status of the target incoming message based on a set status query period.
[0159] If the message processing status is an abnormal status, stop the message processing of the target incoming message, and generate a corresponding message conversion response.
[0160] Send the message conversion response to the corresponding target terminal.
[0161] In an alternative embodiment, during the process of sequentially executing each basic processing step to perform corresponding processing on the target incoming message, the execution module 1203 is further configured to:
[0162] Generate corresponding message conversion information based on the message processing result of the current basic processing step; wherein, the message conversion information is step processing successful or step processing failed;
[0163] If the message conversion information is step processing failed, end the message processing of the target incoming message, and send the message conversion information to the corresponding target terminal.
[0164] If the message conversion information is step processing failed, continue the message processing of the target incoming message.
[0165] Based on the same technical concept, an embodiment of the present application further provides an electronic device, and this electronic device can implement the method flow provided in the above embodiments of the present application. In one embodiment, this electronic device can be a server, or a terminal device or other electronic devices. Figure 13 Exemplarily shows a schematic structural diagram of an electronic device provided in an embodiment of the present application. As Figure 13 shown, this electronic device may include:
[0166] At least one processor 1301, and a memory 1302 connected to at least one processor 1301. In the embodiments of the present application, the specific connection medium between the processor 1301 and the memory 1302 is not limited, Figure 13 in which it is taken as an example that the processor 1301 and the memory 1302 are connected through a bus 1300. The bus 1300 is inFigure 13 is represented by a thick line. The connection manners between other components are only for illustrative purposes and are not limited thereto. The bus 1300 can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 13 is only represented by a thick line in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 1301 can also be referred to as a controller, and there is no limitation on the name.
[0167] In the embodiment of the present application, the memory 1302 stores instructions executable by at least one processor 1301. By executing the instructions stored in the memory 1302, at least one processor 1301 can execute a message processing method described above. The processor 1301 can implement Figure 12 the functions of each module in the device shown.
[0168] Among them, the processor 1301 is the control center of the device. It can connect various parts of the entire control device by using various interfaces and lines. By running or executing the instructions stored in the memory 1302 and calling the data stored in the memory 1302, various functions of the device and process data, so as to monitor the device as a whole.
[0169] In a possible design, the processor 1301 may include one or more processing units. The processor 1301 can integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above modem processor may not be integrated into the processor 1301. In some embodiments, the processor 1301 and the memory 1302 can be implemented on the same chip, and in some embodiments, they can also be separately implemented on independent chips.
[0170] The processor 1301 can be a general-purpose processor, such as a CPU (CPU), a digital signal processor, an application-specific integrated circuit, a field-programmable gate array, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of a message processing method disclosed in combination with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
[0171] The memory 1302, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The memory 1302 may include at least one type of storage medium. For example, it may include flash memory, hard disks, multimedia cards, card-type memories, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic memories, magnetic disks, optical disks, and so on. The memory 1302 is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 1302 in the embodiments of the present application may also be a circuit or any other device capable of implementing a storage function, for storing program instructions and / or data.
[0172] By programming the processor 1301, the code corresponding to the message processing method introduced in the foregoing embodiments can be solidified into the chip, so that the chip can execute Figure 9 the steps of the message processing method of the embodiments shown. How to program the processor 1301 is a well-known technology to those skilled in the art and will not be elaborated here.
[0173] Based on the same inventive concept, the embodiments of the present application also provide a storage medium storing computer instructions, which, when running on a computer, cause the computer to execute a message processing method described above.
[0174] In some possible implementation manners, various aspects of the message processing method provided in the present application can also be implemented in the form of a program product, which includes program code. When the program product runs on a device, the program code causes the control device to execute the steps in the message processing method according to various exemplary embodiments of the present application described above in this specification.
[0175] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0176] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a server, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or combinations of blocks.
[0177] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or combinations of blocks.
[0178] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are performed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or combinations of blocks.
[0179] Obviously, those skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims
1. A message processing method, characterized in that, Including: Receiving a target incoming message, and obtaining a message processing scheme set corresponding to the message type based on the message type of the target incoming message; Setting a risk flag for a basic processing step with a thread blocking probability based on the data processing type corresponding to each basic processing step included in the message processing scheme; Sequentially executing each of the basic processing steps to perform corresponding processing on the target incoming message. Wherein, for each execution of a basic processing step: if the basic processing step is associated with a risk flag, then call an idle dedicated thread from the dedicated thread pool to execute the basic processing step; if the basic processing step is not associated with a risk flag, then call an idle working thread from the working thread pool to execute the basic processing step; Before receiving the target incoming message, it further includes: For a set historical period, obtaining each processed historical message conversion service and its corresponding service processing record; For each of the historical message conversion services, respectively perform the following operations: based on the service processing record corresponding to a historical message conversion service, determining the message type of a processed historical message and the corresponding at least one basic processing step; For each obtained message type, respectively perform the following operations: aggregating the respective basic processing steps corresponding to a message type in different service processing records to obtain the message processing scheme corresponding to the message type.
2. The method according to claim 1, characterized in that, The aggregating the respective basic processing steps corresponding to a message type in different service processing records to obtain the message processing scheme corresponding to the message type includes: Performing deduplication processing on the respective basic processing steps based on the identification information corresponding to each of the basic processing steps; Determining the execution priority corresponding to each of the deduplicated basic processing steps based on the execution time corresponding to each of the basic processing steps; Sorting the deduplicated basic processing steps according to each execution priority to obtain the message processing scheme corresponding to the message type.
3. The method according to claim 1 or 2, characterized in that, The setting a risk flag for a basic processing step with a thread blocking probability based on the data processing type corresponding to each basic processing step included in the message processing scheme includes: For each basic processing step included in the message processing scheme, respectively perform the following operations: Obtaining the data processing type of a basic processing step; wherein the data processing type is an input / output IO type or a non-IO type; When determining that the data processing type of the basic processing step is an IO type, determining that the basic processing step has a thread blocking probability and setting a risk flag corresponding to the basic processing step.
4. The method according to claim 1 or 2, characterized in that, During the process of sequentially executing each of the basic processing steps to perform corresponding processing on the target incoming message, it further includes: Querying the message processing status of the target incoming message based on a set status query period; If the message processing status is an abnormal status, stopping the message processing of the target incoming message and generating a corresponding message conversion response. Send the message conversion response to the corresponding target terminal.
5. The method according to claim 1 or 2, characterized in that, During the process of sequentially executing the respective basic processing steps to perform corresponding processing on the target incoming message, the following is further included: Generate corresponding message conversion information based on the message processing result of the current basic processing step; wherein, the message conversion information is that the step processing is successful or the step processing fails; If the message conversion information is that the step processing fails, end the message processing of the target incoming message and send the message conversion response to the corresponding target terminal; If the message conversion information is that the step processing is successful, continue the message processing of the target incoming message.
6. A message processing device, characterized in that, It includes: A receiving module, configured to receive a target incoming message and obtain a message processing scheme set corresponding to the message type based on the message type of the target incoming message; A marking module, configured to set a risk mark for a basic processing step with a thread blocking probability based on the respective data processing types corresponding to the respective basic processing steps included in the message processing scheme; An execution module, configured to sequentially execute the respective basic processing steps to perform corresponding processing on the target incoming message, wherein, for each execution of a basic processing step: if a risk mark is associated with the basic processing step, call an idle dedicated thread from the dedicated thread pool to execute the basic processing step; if a risk mark is not associated with the basic processing step, call an idle working thread from the working thread pool to execute the basic processing step; Before receiving the target incoming message, the execution module is further configured to: For a set historical period, obtain each processed historical message conversion service and its respective corresponding service processing record; For each of the historical message conversion services, perform the following operations respectively: based on the service processing record corresponding to a historical message conversion service, determine the message type of a processed historical message and the corresponding at least one basic processing step; For each obtained message type, perform the following operations respectively: summarize the respective basic processing steps corresponding to the message type in different service processing records to obtain the message processing scheme corresponding to the message type.
7. The device according to claim 6, characterized in that, When summarizing the respective basic processing steps corresponding to the message type in different service processing records to obtain the message processing scheme corresponding to the message type, the execution module specifically is configured to: Based on the respective identification information corresponding to the respective basic processing steps, perform deduplication processing on the respective basic processing steps; Based on the respective execution times corresponding to the respective basic processing steps, determine the respective execution priorities corresponding to the deduplicated basic processing steps; Sort the deduplicated basic processing steps according to each execution priority to obtain the message processing scheme corresponding to the message type.
8. The device according to claim 6 or 7, characterized in that, When setting a risk mark for a basic processing step with a thread blocking probability based on the respective data processing types corresponding to the respective basic processing steps included in the message processing scheme, the marking module specifically is configured to: For each of the basic processing steps included in the message processing solution, the following operations are performed respectively: Obtain the data processing type of a basic processing step; wherein, the data processing type is input / output (IO) type or non-IO type; When it is determined that the data processing type of the basic processing step is the IO type, determine that the basic processing step has a probability of thread blocking, and set a risk flag corresponding to the basic processing step.
9. The device according to claim 6 or 7, characterized in that, During the process of sequentially executing each of the basic processing steps to perform corresponding processing on the target incoming message, the execution module is further configured to: Query the message processing status of the target incoming message based on a set status query period; If the message processing status is an abnormal status, stop the message processing of the target incoming message and generate a corresponding message conversion response; Send the message conversion response to the corresponding target terminal.
10. The device according to claim 6 or 7, characterized in that, During the process of sequentially executing each of the basic processing steps to perform corresponding processing on the target incoming message, the execution module is further configured to: Generate corresponding message conversion information based on the message processing result of the current basic processing step; wherein, the message conversion information is step processing successful or step processing failed; If the message conversion information is step processing failed, end the message processing of the target incoming message and send the message conversion information to the corresponding target terminal; If the message conversion information is step processing failed, continue the message processing of the target incoming message.
11. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the method according to any one of claims 1-5 when executing the computer program.
12. A computer-readable storage medium, on which a computer program is stored, characterized in that, The computer program, when executed by the processor, implements the steps of the method according to any one of claims 1-5.
13. A computer program product, characterized in that, When the computer program product is called by a computer, it causes the computer to execute the method according to any one of claims 1-5.
Citation Information
Patent Citations
Method and device for controlling message processing threads
CN104572290A
Method and device for batch processing of messages
CN112398735A