Service message processing method and computer system

By pre-applying local memory from threads for targets in a computer system with NUMA architecture, the cross-node access memory problem when microservices process business messages is solved, and system performance is improved.

CN120196460APending Publication Date: 2025-06-24DAWNING INFORMATION IND (BEIJING) CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510220930.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

In computer systems with NUMA architecture, there is a problem of cross-node accessing memory when microservices process business messages, which affects the performance of the computer system.

Method used

Avoid accessing memory across nodes by pre-applying quota memory in the local memory of the processing node and running the target microservice from the target from the thread to process business messages.

Benefits of technology

It realizes that during the process of microservices processing business messages, avoids accessing memory across nodes, improves memory access speed, and reduces memory access delay, thereby improving the performance of computer systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120196460A_ABST
    Figure CN120196460A_ABST
Patent Text Reader

Abstract

The invention relates to a service message processing method and a computer system. The method is applied to any processing node in the business processing system, a target slave thread in a target application program is deployed on the processing node, and the method comprises the following steps: acquiring a business message of a source application program, running a target micro-service in the target slave thread, and processing the business message by accessing a quota memory of the target slave thread, the quota memory is applied from the local memory of the processing node in advance according to an executable configuration file required during the running of the target application program. By adopting the method, the problem of cross-node access to the memory can be avoided in the process of processing the service message by the micro-service, the memory access speed is increased, the memory access delay is reduced, and the performance of a computer system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and particularly to a method for processing service messages and a computer system. Background Art

[0002] With the development of computer technology, more and more application programs are running on computer systems. In practical applications, an application program includes at least one process, and each process includes multiple threads.

[0003] Taking the case where an application program is deployed in a computer system with a Non-Uniform Memory Access (NUMA) architecture as an example, the computer system includes multiple NUMA nodes, each NUMA node is configured with corresponding local memory, and multiple application programs can be deployed in the computer system. Different application programs can be deployed on the same NUMA node or different NUMA nodes.

[0004] In related technologies, there are often scenarios where any source application program interacts with another destination application program. When the destination application program is running, the service messages of the source application program are mainly processed by microservices in the destination application program, and the quota memory of the slave thread to which the microservice belongs is accessed during the processing of service messages.

[0005] However, in related technologies, there is a problem of cross-node memory access during the process of microservices processing service messages, which affects the performance of the computer system. Summary of the Invention

[0006] Based on this, in view of the above technical problems, it is necessary to provide a method for processing service messages and a computer system, which can avoid cross-node memory access during the process of microservices processing service messages and improve the performance of the computer system.

[0007] In a first aspect, an embodiment of this application provides a method for processing service messages, which is applied to any processing node in a service processing system. A target slave thread in a destination application program is deployed on the processing node. The method includes:

[0008] Obtain service messages of a source application program;

[0009] Run a target microservice in the target slave thread and process the service messages by accessing the quota memory of the target slave thread;

[0010] Wherein, the quota memory is pre-applied from the local memory of the processing node according to an executable configuration file required when the destination application program runs.

[0011] The technical solution in the embodiment of the present application is applied to any processing node in the business processing system. A target slave thread in the target application is deployed on the processing node. The business message of the source application is obtained, the target microservice in the target slave thread is run, and the quota memory of the target slave thread is accessed to process the business message. The quota memory is pre-applied from the local memory of the processing node according to the executable configuration file required during the operation of the target application. The above method can apply for memory for the target slave thread in the local memory of the processing node where the target slave thread belongs, so that the quota memory of the target slave thread does not fall into the local memory of other processing nodes where the target slave thread is not deployed, which can achieve node affinity, avoid the problem of cross-node memory access during the microservice processing of business messages, improve the memory access speed, reduce the memory access latency, and thus improve the performance of the computer system. At the same time, the above method allocates memory for the slave thread based on the pre-constructed executable configuration file, which can speed up the memory allocation speed, save the memory allocation time, and reserve more sufficient time for business message processing.

[0012] In one embodiment, the target application includes a first process, and the first process includes a main thread and a target slave thread. Before obtaining the business message of the source application, the method further includes:

[0013] Create the target microservice in the target slave thread according to the main thread in the first process.

[0014] The technical solution in the embodiment of the present application creates the target microservice in the target slave thread according to the main thread in the first process. When the application is running, the above method can flexibly construct microservices according to actual needs, which can not only make the application only include effective microservices, improve the running efficiency of the application, but also improve the flexibility of application function adjustment to improve the wide applicability of the application.

[0015] In one embodiment, creating the target microservice in the target slave thread according to the main thread in the first process includes:

[0016] Run the main thread in the first process to obtain the executable configuration file required during the operation of the target application.

[0017] Create the target slave thread in the first process according to the executable configuration file required during the operation of the target application.

[0018] Run the target slave thread in the first process, and call the target microservice interface according to the executable configuration file required during the operation of the target application to generate the target microservice.

[0019] In the technical solution of the embodiment of the present application, the main thread in the first process is run to obtain the executable configuration file required when the target application program runs. According to the executable configuration file required when the target application program runs, a target slave thread in the first process is created, the target slave thread in the first process is run, and the target microservice interface is called according to the executable configuration file required when the target application program runs to generate a target microservice. When the application program runs, the above method can flexibly create slave threads and microservices according to the executable configuration file required when the application program runs, so that the functions of the application program can be flexibly adjusted according to actual needs, and the slave threads and microservices are created based on the executable configuration file required when the application program runs, thereby being able to accelerate the creation speed of microservices and improve the creation efficiency of microservices.

[0020] In one embodiment, obtaining the business message of the source application program includes:

[0021] Based on the connection channel between the target slave thread and the source slave thread in the source application program, receiving the business message sent by the processing node to which the source slave thread belongs.

[0022] In the technical solution of the embodiment of the present application, based on the connection channel between the target slave thread and the source slave thread, receiving the business message sent by the processing node to which the source slave thread belongs. The above method can transmit the business message of the source application program through the corresponding connection channel between the target slave thread and the source slave thread. This process can avoid transmission conflicts and memory access conflicts, thereby reducing the memory access latency. At the same time, on this basis, the acquisition speed of business messages can be accelerated. In addition, the above method can transmit corresponding messages through an independent connection channel without locking, thereby avoiding lock competition and transmission conflicts.

[0023] In one embodiment, the above method further includes:

[0024] In response to the resource release request of the target slave thread, releasing the quota memory of the target slave thread; and / or,

[0025] In response to the resource release request of the main thread in the first process, releasing the quota memory of the main thread.

[0026] In the technical solution of the embodiment of the present application, in response to the resource release request of the target slave thread, releasing the quota memory of the target slave thread, and / or in response to the resource release request of the main thread in the first process, releasing the quota memory of the main thread. The above method can release memory resources, reduce memory occupation, thereby accelerating the processing speed of business messages and improving the processing efficiency of business messages.

[0027] In a second aspect, an embodiment of the present application provides a method for processing service messages, which is applied to any processing node in a service processing system. A source slave thread in a source application is deployed on the processing node. The method includes:

[0028] Run the source microservice in the source slave thread to generate service messages of the source application;

[0029] Send the service message to the processing node to which the target slave thread in the target application belongs, instruct the processing node to which the target slave thread belongs to run the target microservice in the target slave thread, and process the service message by accessing the quota memory of the target slave thread; the quota memory is pre-applied from the local memory of the processing node to which the target slave thread belongs according to the executable configuration file required during the operation of the target application.

[0030] The technical solution in the embodiment of the present application is applied to any processing node in a service processing system. A source slave thread in a source application is deployed on the processing node. The source microservice in the source slave thread is run to generate service messages of the source application. The service message is sent to the processing node to which the target slave thread in the target application belongs, instructing the processing node to which the target slave thread belongs to run the target microservice in the target slave thread, and processing the service message by accessing the quota memory of the target slave thread, where the quota memory is pre-applied from the local memory of the processing node to which the target slave thread belongs according to the executable configuration file required during the operation of the target application; the above method can apply for memory for the target slave thread in the local memory of the processing node to which the target slave thread belongs, so that the quota memory of the target slave thread does not fall into the local memory of other processing nodes where the target slave thread is not deployed, which can achieve node affinity, avoid the problem of cross-node memory access during the microservice processing of service messages, improve the memory access speed, reduce the memory access latency, and thus improve the performance of the computer system; at the same time, the above method allocates memory for the slave thread based on the pre-constructed executable configuration file, which can speed up the memory allocation speed, save the memory allocation time, and reserve more sufficient time for service message processing.

[0031] In one embodiment, the source application includes a second process, and the second process includes a main thread and a source slave thread; before running the source microservice, the above method further includes:

[0032] Create the source microservice in the source slave thread according to the main thread in the second process.

[0033] In the technical solution of the embodiment of the present application, a source microservice in the source slave thread is created according to the main thread in the second process; when the application program runs, the microservice can be flexibly constructed according to actual needs. In this way, not only can the application program only include effective microservices, improving the running efficiency of the application program, but also the flexibility of function adjustment of the application program can be improved to enhance the wide applicability of the application program.

[0034] In one embodiment, creating a source microservice in the source slave thread according to the main thread in the second process includes:

[0035] Running the main thread in the second process to obtain the executable configuration file required for the source application program to run;

[0036] Creating a source slave thread in the second process according to the executable configuration file required for the source application program to run;

[0037] Running the source slave thread in the second process and calling the source microservice interface according to the executable configuration file required for the source application program to run to generate a source microservice.

[0038] In the technical solution of the embodiment of the present application, running the main thread in the second process, obtaining the executable configuration file required for the source application program to run, creating a source slave thread in the second process according to the executable configuration file required for the source application program to run, running the source slave thread in the second process, and calling the source microservice interface according to the executable configuration file required for the source application program to run to generate a source microservice; when the application program runs, the slave thread and microservice can be flexibly created according to the executable configuration file required for the application program to run, so that the functions of the application program can be flexibly adjusted according to actual needs, and the slave thread and microservice are created based on the executable configuration file required for the application program to run, thereby being able to accelerate the creation speed of the microservice and improve the creation efficiency of the microservice.

[0039] In one embodiment, sending a service message to the processing node to which the target slave thread in the target application program belongs includes:

[0040] In response to the communication instruction of the target microservice, obtaining the connection channel resource between the source slave thread and the target slave thread to which the target microservice belongs according to the communication instruction;

[0041] Sending the service message to the processing node to which the target slave thread belongs based on the connection channel corresponding to the connection channel resource.

[0042] In the technical solution of the embodiment of the present application, in response to a communication instruction of a target microservice, a connection channel resource between a source slave thread and a target slave thread to which the target microservice belongs is obtained according to the communication instruction, and a service message is sent to a processing node to which the target slave thread belongs based on a connection channel corresponding to the connection channel resource; the above method can transmit a service message of a source application program through a corresponding connection channel between the target slave thread and the source slave thread, and this process can avoid transmission conflicts and memory access conflicts, thereby reducing memory access latency. At the same time, on this basis, the acquisition speed of the service message can be increased; in addition, the above method can transmit corresponding messages through an independent connection channel on a lock-free basis, thereby avoiding lock contention and transmission conflicts.

[0043] In one embodiment, the communication instruction carries a target microservice identifier; obtaining a connection channel resource between a source slave thread and a target slave thread to which the target microservice belongs according to the communication instruction includes:

[0044] Searching for the target microservice identifier in a mapping relation table; the mapping relation table includes the corresponding relations between identifiers of different microservices and different channel resources;

[0045] Determining the channel resource corresponding to the identifier that matches the target microservice identifier in the mapping relation table as the connection channel resource.

[0046] In the technical solution of the embodiment of the present application, the target microservice identifier is searched in the mapping relation table, and the channel resource corresponding to the identifier that matches the target microservice identifier in the mapping relation table is determined as the connection channel resource; the above method can obtain the connection channel resources between different slave threads based on a pre-constructed mapping relation table, which can increase the acquisition speed of the connection channel resources and improve the acquisition efficiency of the connection channel resources.

[0047] In a third aspect, an embodiment of the present application provides a service message processing device, and the device includes:

[0048] A message acquisition module, configured to acquire a service message of a source application program;

[0049] A message processing module, configured to run a target microservice in a target slave thread and process the service message by accessing the quota memory of the target slave thread;

[0050] Wherein, the quota memory is pre-applied from the local memory of the processing node according to an executable configuration file required when the destination application program runs.

[0051] In a fourth aspect, an embodiment of the present application provides a service message processing device, and the device includes:

[0052] A message generation module, which is used to run the source microservice in the source slave thread and generate business messages of the source application;

[0053] A message sending module, which is used to send the business message to the processing node to which the target slave thread in the destination application belongs, instruct the processing node to which the target slave thread belongs to run the target microservice in the target slave thread, and process the business message by accessing the quota memory of the target slave thread; the quota memory is pre-applied from the local memory of the processing node to which the target slave thread belongs according to the executable configuration file required during the operation of the destination application.

[0054] In a fifth aspect, an embodiment of the present application further provides a computer system, which includes a memory and a processing node. The memory stores a computer program, and when the processing node executes the computer program, it implements the steps of the method in any one of the above first aspect and second aspect embodiments.

[0055] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by the processing node, it implements the steps of the method in any one of the above first aspect and second aspect embodiments.

[0056] In a seventh aspect, an embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by the processing node, it implements the steps of the method in any one of the above first aspect and second aspect embodiments.

[0057] The above description is only an overview of the technical solutions of the present application. In order to be able to understand the technical means of the present application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of the present application more obvious and understandable, the specific embodiments of the present application are specifically listed below. Description of the Drawings

[0058] Figure 1 It is a schematic flowchart of a business message processing method in an embodiment;

[0059] Figure 2 It is a schematic flowchart of a business message processing method in another embodiment;

[0060] Figure 3 It is a structure diagram of a connection channel between different threads in an embodiment;

[0061] Figure 4 It is a schematic flowchart of a business message processing method in another embodiment;

[0062] Figure 5 It is a schematic flowchart of a business message processing method in another embodiment;

[0063] Figure 6 It is a schematic flowchart of a service message processing method in another embodiment;

[0064] Figure 7 It is a schematic flowchart of a service message processing method in another embodiment;

[0065] Figure 8 It is a schematic flowchart of a service message processing method in another embodiment;

[0066] Figure 9 It is a structural block diagram of a service message processing apparatus in an embodiment;

[0067] Figure 10 It is a structural block diagram of a service message processing apparatus in another embodiment;

[0068] Figure 11 It is an internal structural diagram of a computer system in an embodiment. Detailed implementation manners

[0069] In order to make the objectives, technical solutions and advantages of the present application more clear and understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0070] In the field of service processing, there are more and more application programs running on a computer system. Among them, an application program is implemented by at least one process, each process is implemented by multiple threads (i.e., a main thread and at least one subordinate thread), and each thread is implemented by multiple microservices. Taking an application program deployed in a computer system with a NUMA architecture as an example, the computer system includes multiple NUMA nodes, each NUMA node is configured with a corresponding local memory, multiple application programs can be deployed in the computer system, and different application programs can be deployed on the same NUMA node or different NUMA nodes, and each NUMA node may include multiple central processing units (CPUs). In the related art, there is often a scenario where any source application program interacts and accesses another destination application program. When the destination application program is running, the microservices in the destination application program are mainly used to process the service messages of the source application program, and the quota memory of the subordinate thread to which the microservice belongs will be accessed during the service message processing.

[0071] However, in the related art, when microservices process business messages, they may access the local memory of other NUMA nodes, resulting in the problem of cross-node memory access, which affects the performance of the computer system. Based on this, the embodiments of the present application provide a business message processing method that can avoid cross-node memory access during the process of microservices processing business messages, improve the memory access speed, and improve the performance of the computer system.

[0072] The business message processing method provided by the embodiments of the present application is applicable to a business message processing system, which may include multiple processing nodes and multiple local memories, and each processing node is configured with a corresponding local memory. Among them, a destination application can be deployed on any processing node, and / or a source application can also be deployed on any processing node; the processing nodes where the source application and the destination application are located can be the same processing node or different processing nodes. Optionally, different NUMA nodes can be communicatively connected, and this connection method can be Wi-Fi, mobile network, Bluetooth connection, etc., which is not limited in the embodiments of the present application. In the embodiments of the present application, the above-mentioned processing nodes can be NUMA nodes. Hereinafter, the embodiments of the present application will take any processing node in the business message processing system as the execution subject of the business message processing method to introduce the specific process of the business message processing method.

[0073] As Figure 1 shown, it is a schematic flowchart of the business message processing method provided by the embodiments of the present application. This method is applied to any processing node in the business processing system, and a target slave thread in the destination application is deployed on the processing node. This method can be implemented through the following steps:

[0074] S101. Obtain the business message of the source application.

[0075] It should be noted here that any application can include at least one process, each process can include multiple threads, and each thread can include multiple microservices. Correspondingly, the destination application includes multiple microservices, and the multiple microservices can be deployed on the same processing node in the business processing system or on multiple processing nodes in the business processing system.

[0076] In practical applications, the processing node where the target slave thread is deployed can read the business message of the source application from local, disk, hard disk, cloud, etc., and can also receive the business message of the source application sent by a third-party device. Optionally, the above-mentioned business message can be business information in fields such as communication, gaming, e-commerce, finance, logistics, energy, and technology, and the type of this business message can be, but is not limited to, video information, voice information, and text information.

[0077] S102. Run the target microservice in the target slave thread in the processing node, and process the service message by accessing the quota memory of the target slave thread. The quota memory is pre-allocated from the local memory of the processing node according to the executable configuration file required during the runtime of the destination application.

[0078] In the embodiment of the present application, in fact, it is the microservice that processes the service message. Among them, when the service message of the source application needs to be processed by the target microservice, the processing node deploying the target slave thread can trigger the target microservice in the target slave thread in the processing node, and process the service message by accessing the quota memory of the target slave thread.

[0079] It should be noted here that processing the service message can be understood as the process of writing the service message into the quota memory of the target slave thread or reading it from the quota memory of the target slave thread, or the process of writing the processing result generated after processing the service message into the quota memory of the target slave thread. The embodiment of the present application does not limit this.

[0080] Among them, in the service processing system, each processing node is configured with its own corresponding local memory. The processing node can build the executable configuration file required during the runtime of the destination application according to the principle of NUMA affinity (or node affinity). Further, the corresponding quota memory can be allocated from the local memory of the processing node for the target slave thread according to the executable configuration file required during the runtime of the destination application, so that the quota memory of the target slave thread is located in the local memory of the processing node to which the target slave thread belongs.

[0081] Optionally, the above principle of NUMA affinity can be understood as that the memory allocated to a thread or process is located in the local memory of its respective processing node, rather than falling into the local memory of other processing nodes. In this way, during the service message processing process, the problem of cross-node memory access can be avoided, and the running speed of the thread can be improved.

[0082] The technical solution in the embodiment of the present application is applied to any processing node in the business processing system. A target slave thread in the target application is deployed on the processing node. The business message of the source application is obtained, the target microservice in the target slave thread is run, and the quota memory of the target slave thread is accessed to process the business message. The quota memory is pre-applied from the local memory of the processing node according to the executable configuration file required during the operation of the target application. The above method can apply memory for the target slave thread in the local memory of the processing node where the target slave thread belongs, so that the quota memory of the target slave thread does not fall into the local memory of other processing nodes where the target slave thread is not deployed, which can achieve node affinity, avoid the problem of cross-node memory access during the microservice processing of business messages, improve the memory access speed, reduce the memory access latency, and thus improve the performance of the computer system. At the same time, the above method allocates memory for the slave thread based on the pre-constructed executable configuration file, which can accelerate the memory allocation speed, save the memory allocation time, and reserve more sufficient time for business message processing.

[0083] In practical applications, before obtaining the business message of the source application, the processing node deploying the target slave thread needs to first create the target microservice to ensure normal interaction between the target slave thread and the source slave thread. In one embodiment, the target application includes a first process, and the first process includes a main thread and a target slave thread. Before obtaining the business message of the source application, the above method may further include: creating the target microservice in the target slave thread according to the main thread in the first process.

[0084] In practical applications, the above processing node may call a microservice creation tool to create the target microservice in the target slave thread according to the main thread in the first process.

[0085] In addition, the above processing node may create the target microservice in the target slave thread according to the main thread in the first process according to a preset microservice creation method.

[0086] In one embodiment, as Figure 2 shown, the step of creating the target microservice in the target slave thread according to the main thread in the first process may be implemented in the following manner:

[0087] S103. Run the main thread in the first process to obtain the executable configuration file required during the operation of the target application.

[0088] In the embodiment of the present application, the processing node deploying the target slave thread may trigger the main thread in the first process to run and read the executable configuration file required during the operation of the target application from the storage location. Among them, the above storage location may be local, disk, hard disk, cloud, etc.

[0089] Among them, the service message processing system may include multiple central processing units; the executable configuration file may include the logical core group configuration information of each processing node, the process configuration information of different processes in each application deployed in the service message processing system, the thread configuration information of each thread in each process, the memory configuration information corresponding to each NUMA node in the service message processing system, the communication configuration information of each application, and the microservice configuration information of each thread, etc., and all these information are determined according to the corresponding configuration rules.

[0090] Here, it should be noted that each central processing unit (CPU) in the service message processing system can be divided into multiple processing nodes (i.e., NUMA nodes). Multiple CPUs in different NUMA nodes can be divided into a logical core group, and different processes, threads, and microservices can be deployed or bound to a fixed corresponding logical core group. Further, based on these division, deployment, and binding rules, the logical core group configuration information of each processing node is generated.

[0091] For example, the service message processing system includes 4 NUMA nodes (NUMA node 0, NUMA node 1, NUMA node 2, and NUMA node 3). Among them, NUMA node 0 may include CPU0 - 15 and CPU64 - 79 in the service message processing system, NUMA node 1 may include CPU16 - 31 and CPU80 - 95 in the service message processing system, NUMA node 2 may include CPU32 - 47 and CPU96 - 111 in the service message processing system, NUMA node 3 may include CPU48 - 63 and CPU112 - 127 in the service message processing system, and, these 4 CPUs, namely CPU0, CPU16, CPU32, and CPU48, are divided into a logical core group A, and these 2 CPUs, namely CPU47 and CPU63, are divided into a logical core group B.

[0092] Among them, the process configuration information of the above - mentioned different processes may be configuration information determined based on attributes such as the startup path of different processes (i.e., the path where the executable binary file corresponding to different processes is located), the thread pool included in each process, the logical core group to which each process belongs, and the scheduling type of different processes. Optionally, the above - mentioned thread pool can be understood as a set composed of multiple threads with the same business function in the same process.

[0093] Meanwhile, the thread configuration information of the above different threads can be configuration information determined based on attributes such as each coroutine included in different threads, the coroutine pool to which each coroutine belongs, the coroutine pool name, the coroutine pool type, the coroutine pool size, the scheduling type of each coroutine, the scheduling type of each thread, the thread pool name to be configured for each thread, the thread pool type, the number of threads in each thread pool, the number of coroutines in each thread pool, the logical core group bound by each thread pool, and the mapping relationship between each thread and the logical core group in the thread pool.

[0094] Among them, the mapping relationship can be a segmented mapping relationship or a round-robin mapping relationship. For example, there are 8 threads in thread pool X (i.e., threads 0 - 8), which are bound to logical core group Y with 4 CPUs (i.e., CPU0 - 3). The binding according to the segmented mapping relationship is as follows: thread 0 and thread 1 are bound to CPU0, thread 2 and thread 3 are bound to CPU1, thread 4 and thread 5 are bound to CPU2, and thread 6 and thread 7 are bound to CPU3; the binding according to the round-robin mapping relationship is as follows: thread 0 and thread 4 are bound to CPU0, thread 1 and thread 5 are bound to CPU1, thread 2 and thread 6 are bound to CPU2, and thread 3 and thread 7 are bound to CPU3.

[0095] Optionally, the memory configuration information corresponding to each of the above NUMA nodes can be determined based on the memory allocation rule. Optionally, the memory allocation rule can be to divide and reserve memory from each local memory according to the number of NUMA nodes and the size of the local memory corresponding to each NUMA node in the service message processing system, then divide different functional domains based on the total reserved memory, and then allocate memory (i.e., functional areas) for processes, threads, microservices, coroutines, connection channels, logs to be generated, etc. bound to different NUMA nodes from the functional domains corresponding to different NUMA nodes. Among them, the above functional domains can be communication domains, power protection domains, private domains, etc.; the functional areas can be log areas, power protection areas, coroutine stack areas, communication areas, etc. In practical applications, applying for quota memory based on the memory configuration information can make the address of the applied quota memory fixed, and there will be no page fault swapping and other situations under the operating system of the service message processing system, and it can also make the mapping between the actual address and the physical address of the applied quota memory simpler, facilitating cross-process memory access.

[0096] It should be noted here that the quota memory of all threads under any process cannot exceed the quota memory of that process, the quota memory of all microservices under any thread cannot exceed the quota memory of that thread, and the quota memory of all coroutines under any microservice cannot exceed the quota memory of that microservice.

[0097] In addition, the communication configuration information of each application program can be configuration information determined based on attributes such as connection channels between different processes and connection channels between different threads in the configuration rule.

[0098] Meanwhile, the microservice configuration information of each thread can be the configuration information determined based on attributes such as the number of microservices in different threads, the binding relationship between different microservices and different threads, the names of each microservice, the scheduling type of each microservice, and the NUMA nodes bound by each microservice in the configuration rules.

[0099] Among them, the construction process of the executable configuration file is described as follows: an original configuration file can be created first, and then the configuration information in the original configuration file is subjected to correctness detection. When it is determined that the original configuration file passes the correctness check, the original configuration file is compiled into a binary file, which is the executable configuration file. Optionally, the above-mentioned correctness detection can be processes such as whether the quota memory of each process exceeds the total reserved memory, and whether the CPUs configured in the logical core group exist in the service message processing system.

[0100] S104. Create a target slave thread in the first process according to the executable configuration file required when the target application program runs.

[0101] Furthermore, the processing node for deploying the target slave thread can create each slave thread in the first process according to the thread configuration information of each thread in the executable configuration file required when the target application program runs, thus completing the creation of the target slave thread in the first process.

[0102] S105. Run the target slave thread in the first process, and call the target microservice interface according to the executable configuration file required when the target application program runs to generate a target microservice.

[0103] Specifically, based on the target slave thread created in the previous steps, the processing node for deploying the target slave thread can trigger the running of the target slave thread in the first process, and then call the target microservice interface according to the microservice configuration information of the target slave thread in the executable configuration file required when the target application program runs, so as to add the target microservice interface to the corresponding position in the target slave thread to generate a target microservice, that is, complete the creation of the target microservice.

[0104] Among them, the above-mentioned target microservice interface can be an initialization interface, an anti-initialization interface, a start interface, a stop interface, etc. In practical applications, the above-mentioned target microservice interface can be an interface published by an interface publishing tool and can be directly called.

[0105] In the technical solution of the embodiment of the present application, the main thread in the first process is run to obtain the executable configuration file required when the target application runs. According to the executable configuration file required when the target application runs, a target slave thread in the first process is created, the target slave thread in the first process is run, and the target microservice interface is called according to the executable configuration file required when the target application runs to generate a target microservice. In the above method, when the application runs, slave threads and microservices can be flexibly created according to the executable configuration file required when the application runs, so that the functions of the application can be flexibly adjusted according to actual needs, and slave threads and microservices are created based on the executable configuration file required when the application runs, thereby being able to accelerate the creation speed of microservices and improve the creation efficiency of microservices.

[0106] In the technical solution of the embodiment of the present application, a target microservice in the target slave thread is created according to the main thread in the first process. In the above method, when the application runs, microservices can be flexibly constructed according to actual needs. This can not only make the application only include effective microservices, improve the running efficiency of the application, but also improve the flexibility of application function adjustment to improve the wide applicability of the application.

[0107] The process of obtaining the business message of the source application described above will be described below. In one embodiment, the steps in S101 may include: receiving the business message sent by the processing node to which the source slave thread belongs based on the connection channel between the target slave thread and the source slave thread in the source application.

[0108] Among them, there are respective corresponding connection channels between different slave threads in the source application and different slave threads in the target application. As Figure 3 shown, different connection channels are independent. Based on this, when the processing nodes to which different slave threads in the source application belong send relevant messages to the processing nodes to which different slave threads in the target application belong based on different connection channels, the situation of connection channel resource preemption and transmission conflict can be avoided.

[0109] In practical applications, when the processing nodes to which different slave threads in the source application belong interact with the processing nodes to which different slave threads in the target application belong through different connection channels, they will all access the quota memory corresponding to each connection channel. Since different connection channels are independent, there will be no situation of memory access conflict when transmitting relevant messages through any connection channel, which can reduce the memory access latency. In the embodiment of the present application, the above connection channel can be represented by QP.

[0110] Specifically, the processing node to which the source slave thread belongs can send business messages of the source application based on the connection channel between the target slave thread and the source slave thread. Correspondingly, the processing node to which the target slave thread belongs can receive the business messages sent by the processing node to which the source slave thread belongs based on the connection channel between the target slave thread and the source slave thread.

[0111] The technical solution in the embodiment of the present application receives business messages sent by the processing node to which the source slave thread belongs based on the connection channel between the target slave thread and the source slave thread; the above method can transmit business messages of the source application through the corresponding connection channel between the target slave thread and the source slave thread, and this process can avoid transmission conflicts and memory access conflicts, thereby reducing memory access latency. At the same time, on this basis, it can accelerate the acquisition speed of business messages; in addition, the above method can transmit corresponding messages through an independent connection channel on a lock-free basis, thereby avoiding lock contention and transmission conflicts.

[0112] In practical applications, after any slave thread and the main thread finish running, the corresponding memory resources can be released to reduce memory occupancy and accelerate the processing speed of business messages. The process of releasing memory resources will be described below. In one embodiment, after performing the steps in S102 as Figure 4 shown, the above method may further include:

[0113] S106. In response to a resource release request of the target slave thread, release the quota memory of the target slave thread.

[0114] Specifically, during the process of processing business messages, when there is a need to release memory resources and the target slave thread has finished running, the processing node to which the target slave thread belongs can receive an externally input resource release request of the target slave thread, and in response to the resource release request of the target slave thread, release the quota memory of the target slave thread to complete the release of the memory resources of the target slave thread.

[0115] S107. In response to a resource release request of the main thread in the first process, release the quota memory of the main thread.

[0116] In addition, during the process of processing business messages, when there is a need to release memory resources and the main thread has finished running, the processing node to which the target slave thread belongs can receive an externally input resource release request of the main thread in the first process, and in response to the resource release request of the main thread in the first process, release the quota memory of the main thread in the first process to complete the release of the memory resources of the main thread in the first process.

[0117] It should be noted here that either of the above steps S106 and S107 can be executed during the business message processing, or both can be executed step by step. The embodiments of the present application do not limit this. Among them, Figure 4 shows a flowchart in which both steps S106 and S107 are executed.

[0118] In the technical solution of the embodiments of the present application, in response to the resource release request of the target slave thread, the quota memory of the target slave thread is released, and / or in response to the resource release request of the main thread in the first process, the quota memory of the main thread is released; the above method can release memory resources, reduce memory occupancy, thereby accelerating the speed of business message processing and improving the efficiency of business message processing.

[0119] In one embodiment, the embodiments of the present application further provide a business message processing method, which is applied to any processing node in the business processing system, and the target slave thread in the target application program is deployed on the processing node. The method includes the following processes:

[0120] S10. Run the main thread in the first process of the target application program to obtain the executable configuration file required for the operation of the target application program;

[0121] S11. Create the target slave thread in the first process according to the executable configuration file required for the operation of the target application program;

[0122] S12. Run the target slave thread in the first process, and call the target microservice interface according to the executable configuration file required for the operation of the target application program to generate the target microservice in the target slave thread in the first process;

[0123] S13. Based on the connection channel between the target slave thread and the source slave thread in the source application program, receive the business message sent by the processing node where the source slave thread belongs;

[0124] S14. Run the target microservice in the target slave thread, and process the business message by accessing the quota memory of the target slave thread; among them, the quota memory is pre-applied from the local memory of the processing node according to the executable configuration file required for the operation of the target application program;

[0125] S15. In response to the resource release request of the target slave thread, release the quota memory of the target slave thread; and / or,

[0126] S16. In response to the resource release request of the main thread in the first process, release the quota memory of the main thread.

[0127] For the execution processes of S10 to S16 above, please refer to the descriptions of the above embodiments for details. Their implementation principles and technical effects are similar and will not be elaborated here.

[0128] To solve the problem of cross-node memory access that exists in the related art during the process of microservices handling business messages, an embodiment of the present application also provides a business message processing method, which can avoid cross-node memory access during the process of microservices handling business messages and improve the performance of the computer system. The specific process of the business message processing method will be introduced from the perspective of the processing node where the source slave thread belongs.

[0129] As Figure 5 shown, it is a schematic flowchart of the business message processing method provided by an embodiment of the present application. This method is applied to any processing node in the business processing system, and the source microservice in the source application is deployed on the processing node. This method can be implemented through the following steps:

[0130] S201. Run the source microservice in the source slave thread to generate a business message of the source application.

[0131] In practical applications, the processing node where the source slave thread is deployed can trigger the running of the source microservice in the source slave thread to perform corresponding business processing and generate a business message of the source application.

[0132] Among them, the source application can include at least one process. Among them, the second process in the source application can include multiple slave threads, and the source slave thread can include multiple microservices. Optionally, the second process can be any one of at least one process in the source application, the source slave thread can be any one of the multiple slave threads in the second process, and the source microservice can be any one of the multiple microservices in the source slave thread.

[0133] Optionally, the above business message can be business information in fields such as communication, gaming, e-commerce, finance, logistics, energy, and technology. The type of this business message can be, but is not limited to, video information, voice information, and text information.

[0134] S202. Send the business message to the processing node where the target slave thread in the target application belongs, instruct the processing node where the target slave thread belongs to run the target microservice in the target slave thread, and process the business message by accessing the quota memory of the target slave thread. Among them, the quota memory is pre-applied from the local memory of the processing node where the target slave thread belongs according to the executable configuration file required during the operation of the target application.

[0135] Specifically, the processing node where the source slave thread is deployed can send the generated business message to the processing node where the target slave thread in the target application belongs, instruct the processing node where the target slave thread belongs to trigger the running of the target microservice in the target slave thread, and process the business message by accessing the quota memory of the target slave thread.

[0136] It should be noted here that processing the service message can be understood as a process of writing the service message into the quota memory of the target slave thread or reading it from the quota memory of the target slave thread. It can also be understood as a process of writing the processing result generated after processing the service message into the quota memory of the target slave thread. The embodiments of the present application do not limit this.

[0137] Among them, in the service processing system, each processing node is configured with its own corresponding local memory. The processing node can build an executable configuration file required for the target application to run according to the principle of NUMA affinity (or node affinity). Further, according to the executable configuration file required for the target application to run, the corresponding quota memory can be applied for the target slave thread from the local memory of the processing node, so that the quota memory of the target slave thread is located in the local memory of the processing node to which the target slave thread belongs.

[0138] Optionally, the above principle of NUMA affinity can be understood as that the memory allocated to a thread or process is located in the local memory of the processing node to which it belongs, rather than falling into the local memory of other processing nodes. This can avoid the problem of cross-node memory access during the service message processing.

[0139] The technical solution in the embodiments of the present application is applied to any processing node in the service processing system. The source slave thread in the source application is deployed on the processing node, and the source microservice in the source slave thread runs to generate the service message of the source application. The service message is sent to the processing node to which the target slave thread in the target application belongs, instructing the processing node to which the target slave thread belongs to run the target microservice in the target slave thread, and the service message is processed by accessing the quota memory of the target slave thread, where the quota memory is pre-applied from the local memory of the processing node to which the target slave thread belongs according to the executable configuration file required for the target application to run; the above method can apply memory for the target slave thread in the local memory of the processing node to which the target slave thread belongs, so that the quota memory of the target slave thread does not fall into the local memory of other processing nodes where the target slave thread is not deployed, which can achieve node affinity, avoid the problem of cross-node memory access during the microservice processing of the service message, improve the memory access speed, reduce the memory access latency, and thus improve the performance of the computer system; at the same time, the above method allocates memory for the slave thread based on the pre-built executable configuration file, which can accelerate the memory allocation speed, save the memory allocation time, and reserve more sufficient time for the service message processing.

[0140] In practical applications, before running the source microservice, the processing node that deploys the source slave thread needs to first create the source microservice. The following describes the creation process of the source microservice. In one embodiment, the source application includes a second process, and the second process includes a main thread and a source slave thread; before obtaining the business messages of the source application, the above method may further include: creating the source microservice in the source slave thread according to the main thread in the second process.

[0141] In practical applications, the above-mentioned processing node that deploys the source slave thread may call a microservice creation tool to create the source microservice in the source slave thread according to the main thread in the second process.

[0142] In addition, the above-mentioned processing node may create the source microservice in the source slave thread according to a preset microservice creation method according to the main thread in the second process.

[0143] In one embodiment, as Figure 6 shown, the steps of creating the source microservice in the source slave thread according to the main thread in the second process may be implemented in the following manner:

[0144] S203. Run the main thread in the second process to obtain the executable configuration file required for the source application to run.

[0145] In the embodiment of the present application, the processing node that deploys the source slave thread may trigger the main thread in the second process to run and read the executable configuration file required for the source application to run from the storage location. Among them, the above-mentioned storage location may be a local location, a disk, a hard disk, a cloud, etc.

[0146] Among them, the business message processing system may include multiple central processing units; the above-mentioned executable configuration file may include the logical core group configuration information of each processing node, the process configuration information of different processes in each application deployed in the business message processing system, the thread configuration information of each thread in each process, the memory configuration information corresponding to each NUMA node in the business message processing system, the communication configuration information of each application, and the microservice configuration information of each thread, etc. In the embodiment of the present application, the executable configuration file required for the target application to run and the executable configuration file required for the source application to run may be different executable configuration files, or may be the same executable configuration file.

[0147] S204. Create the source slave thread in the second process according to the executable configuration file required for the source application to run.

[0148] Further, the processing node that deploys the source slave thread may create each slave thread in the second process according to the thread configuration information of each thread in the executable configuration file required for the source application to run, and thus complete the creation of the source slave thread in the second process.

[0149] S205. Run the source slave thread in the second process, call the source microservice interface according to the executable configuration file required when the source application runs, and generate the source microservice.

[0150] Specifically, based on the source slave thread created in the previous steps, the processing node for deploying the source slave thread can trigger the running of the source slave thread in the second process, and then call the source microservice interface according to the microservice configuration information of the source slave thread in the executable configuration file required when the source application runs, so as to add the source microservice interface to the corresponding position in the source slave thread to generate the source microservice, that is, complete the creation of the source microservice.

[0151] Among them, the above source microservice interface can be an initialization interface, an anti-initialization interface, a start interface, a stop interface, etc. In practical applications, the above source microservice interface can be an interface published by an interface publishing tool and can be directly called.

[0152] In the technical solution of this application embodiment, run the main thread in the second process, obtain the executable configuration file required when the source application runs, create the source slave thread in the second process according to the executable configuration file required when the source application runs, run the source slave thread in the second process, and call the source microservice interface according to the executable configuration file required when the source application runs to generate the source microservice; the above method can flexibly create slave threads and microservices according to the executable configuration file required when the application runs during the application running, so that the functions of the application can be flexibly adjusted according to actual needs, and the slave threads and microservices are created based on the executable configuration file required when the application runs, thereby being able to accelerate the creation speed of the microservice and improve the creation efficiency of the microservice.

[0153] In the technical solution of this application embodiment, create the source microservice in the source slave thread according to the main thread in the second process; the above method can flexibly construct microservices according to actual needs during the application running, which can not only make the application only include effective microservices, improve the running efficiency of the application, but also improve the flexibility of application function adjustment to improve the wide applicability of the application.

[0154] The following describes the process of sending the service message to the processing node to which the target slave thread in the destination application belongs. In one embodiment, as Figure 7 shown, the steps in the above S202 can be implemented in the following manner:

[0155] S212. In response to the communication instruction of the target microservice, obtain the connection channel resource between the source slave thread and the target slave thread to which the target microservice belongs according to the communication instruction.

[0156] In practical applications, if the business messages generated by the source microservice need to be sent to the target microservice for processing, at this time, communication is required between the source slave thread to which the source microservice belongs and the target slave thread to which the target microservice belongs, so that the processing node deploying the source slave thread can transmit the business messages of the source application to the processing node to which the target slave thread belongs.

[0157] Specifically, the processing node deploying the source slave thread can receive the communication instruction of the target microservice input from the outside world, and in response to the communication instruction of the target microservice, obtain the connection channel resource between the source slave thread and the target slave thread to which the target microservice belongs according to the communication instruction.

[0158] In one embodiment, the processing node deploying the source slave thread can perform analysis processing and / or extraction processing on the information carried in the communication instruction to obtain the connection channel resource between the source slave thread and the target slave thread to which the target microservice belongs. Among them, the connection channel resources between different slave threads can be carried in the communication instruction.

[0159] In another embodiment, the processing node deploying the source slave thread can pre-train an algorithm model, and then input the communication instruction into the algorithm model, and the algorithm model outputs the connection channel resource between the source slave thread and the target slave thread to which the target microservice belongs.

[0160] In the embodiment of the present application, the connection channel resource may include information such as the corresponding connection channel and the identifier of the connection channel.

[0161] S222. Send the business message to the processing node to which the target slave thread belongs based on the connection channel corresponding to the connection channel resource.

[0162] Further, based on the connection channel resource between the source slave thread and the target slave thread to which the target microservice belongs obtained in the previous step, the processing node deploying the source slave thread can send the business message to the processing node to which the target slave thread belongs through the connection channel corresponding to the connection channel resource.

[0163] Correspondingly, the processing node to which the target slave thread belongs can receive the business message sent by the processing node deploying the source slave thread through the connection channel corresponding to the connection channel resource.

[0164] Among them, there are respective corresponding connection channels between different slave threads in the source application and different slave threads in the destination application. Continuing to refer to Figure 3 , the different connection channels are independent. Based on this, when the processing nodes to which different slave threads in the source application send relevant messages to the processing nodes to which different slave threads in the destination application based on different connection channels, the situation of transmission conflict can be avoided.

[0165] In practical applications, when different slave threads in the source application communicate with different slave threads in the destination application through different connection channels, each connection channel's corresponding quota memory will be accessed. Since different connection channels are independent, there will be no memory access conflicts when transmitting relevant messages through any connection channel, which can reduce the memory access latency.

[0166] In the technical solution of the embodiment of the present application, in response to a communication instruction of a target microservice, connection channel resources between a source slave thread and a target slave thread to which the target microservice belongs are obtained according to the communication instruction, and a service message is sent to a processing node to which the target slave thread belongs based on the connection channel corresponding to the connection channel resources; the above method can transmit the service message of the source application through the corresponding connection channel between the target slave thread and the source slave thread. This process can avoid transmission conflicts and memory access conflicts, thereby reducing the memory access latency. At the same time, on this basis, the acquisition speed of the service message can be accelerated; in addition, the above method can transmit corresponding messages through independent connection channels without locking, thereby avoiding lock competition and transmission conflicts.

[0167] The process of obtaining the connection channel resources between the source slave thread and the target slave thread to which the target microservice belongs according to the communication instruction will be described below. In one embodiment, the communication instruction carries a target microservice identifier; as Figure 8 shown, the steps in S212 above can be implemented in the following manner:

[0168] S2121. Search for the target microservice identifier in the mapping relation table. The mapping relation table includes the corresponding relationship between the identifiers of different microservices and different channel resources.

[0169] In practical applications, the processing node deploying the source slave thread can search for the identifier of the microservice that matches the target microservice identifier carried in the communication instruction in the mapping relation table. The mapping relation table is created during the process of microservice creation and connection channel configuration.

[0170] S2122. Determine the channel resources corresponding to the identifier that matches the target microservice identifier in the mapping relation table as the connection channel resources.

[0171] Furthermore, the processing node deploying the source slave thread can obtain the channel resources corresponding to the identifier that matches the target microservice identifier in the mapping relation table, and determine the obtained channel resources as the connection channel resources between the source slave thread and the target slave thread to which the target microservice belongs.

[0172] In the technical solution of the embodiment of the present application, the target microservice identifier is searched in the mapping relationship table, and the channel resource corresponding to the identifier that matches the target microservice identifier in the mapping relationship table is determined as the connection channel resource; the above method can obtain the connection channel resources between different slave threads based on the pre-constructed mapping relationship table, which can accelerate the acquisition speed of the connection channel resources and improve the acquisition efficiency of the connection channel resources.

[0173] In one embodiment, the embodiment of the present application further provides a service message processing method, which is applied to any processing node in the service processing system, and the source slave thread in the source application program is deployed on the processing node. The method includes the following processes:

[0174] S20. Run the main thread in the second process of the source application program to obtain the executable configuration file required when the source application program runs;

[0175] S21. Create the source slave thread in the second process according to the executable configuration file required when the source application program runs;

[0176] S22. Run the source slave thread in the second process, and call the source microservice interface according to the executable configuration file required when the source application program runs to generate the source microservice in the source slave thread;

[0177] S23. Run the source microservice in the source slave thread to generate the service message of the source application program;

[0178] S24. In response to the communication instruction of the target microservice, search for the target microservice identifier carried in the communication instruction in the mapping relationship table; the mapping relationship table includes the corresponding relationship between the identifiers of different microservices and different channel resources;

[0179] S25. Determine the channel resource corresponding to the identifier that matches the target microservice identifier in the mapping relationship table as the connection channel resource;

[0180] S26. Based on the connection channel corresponding to the connection channel resource, send the service message to the processing node where the target slave thread belongs, instruct the processing node where the target slave thread belongs to run the target microservice in the target slave thread, and process the service message by accessing the quota memory of the target slave thread; the quota memory is pre-applied from the local memory of the processing node where the target slave thread belongs according to the executable configuration file required when the destination application program runs.

[0181] For the specific execution process of S20 to S26 above, reference can be specifically made to the description of the above embodiment, and its implementation principle and technical effect are similar, and will not be elaborated here.

[0182] It should be understood that although the steps in the flowcharts involved in the above embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.

[0183] Based on the same inventive concept, an embodiment of the present application further provides a service message processing device for implementing the service message processing method involved above. The solution provided by this device to solve the problem is similar to the solution recorded in the above method. Therefore, the specific limitations in one or more embodiments of the service message processing device provided below can refer to the limitations on the service message processing method in the above text, and will not be repeated here.

[0184] In one embodiment, Figure 9 is a schematic structural diagram of a service message processing device in an embodiment of the present application. The service message processing device provided by the embodiment of the present application can be applied to any processing node in the service processing system, and a target slave thread in the target application program is deployed on the processing node. As Figure 9 shown, the service message processing device of the embodiment of the present application may include: a message acquisition module 11 and a message processing module 12, where:

[0185] The message acquisition module 11 is used to acquire service messages of the source application program;

[0186] The message processing module 12 is used to run the target microservice in the target slave thread and process the service message by accessing the quota memory of the target slave thread;

[0187] Among them, the quota memory is pre-applied from the local memory of the processing node according to the executable configuration file required during the operation of the target application program.

[0188] The service message processing device provided by the embodiment of the present application can be used to execute the technical solutions in the above embodiments of the service message processing method of the present application. The implementation principle and technical effects are similar, and will not be repeated here.

[0189] In one of the embodiments, the target application program includes a first process, the first process includes a main thread and a target slave thread; the service message processing device includes: a target microservice creation module, where:

[0190] A target microservice creation module, configured to create a target microservice in a target slave thread according to the main thread in a first process.

[0191] The business message processing device provided by an embodiment of the present application can be used to execute the technical solutions in the above-mentioned business message processing method embodiments of the present application. The implementation principles and technical effects are similar and will not be elaborated here.

[0192] In one embodiment, the target microservice creation module is specifically configured to:

[0193] Run the main thread in the first process to obtain an executable configuration file required for the purpose application to run;

[0194] Create a target slave thread in the first process according to the executable configuration file required for the purpose application to run;

[0195] Run the target slave thread in the first process, and call the target microservice interface according to the executable configuration file required for the purpose application to run to generate a target microservice.

[0196] The business message processing device provided by an embodiment of the present application can be used to execute the technical solutions in the above-mentioned business message processing method embodiments of the present application. The implementation principles and technical effects are similar and will not be elaborated here.

[0197] In one embodiment, the message acquisition module 11 includes: a message receiving unit, where:

[0198] The message receiving unit is configured to receive a business message sent by a processing node to which the source slave thread belongs based on a connection channel between the target slave thread and the source slave thread in the source application.

[0199] The business message processing device provided by an embodiment of the present application can be used to execute the technical solutions in the above-mentioned business message processing method embodiments of the present application. The implementation principles and technical effects are similar and will not be elaborated here.

[0200] In one embodiment, the business message processing device includes: a first memory release module and a second memory release module, where:

[0201] The first memory release module is configured to release the quota memory of the target slave thread in response to a resource release request of the target slave thread; and / or,

[0202] The second memory release module is configured to release the quota memory of the main thread in response to a resource release request of the main thread in the first process.

[0203] The service message processing device provided by the embodiment of the present application can be used to execute the technical solutions in the above-mentioned embodiment of the service message processing method of the present application. The implementation principle and technical effect are similar, and will not be elaborated here.

[0204] In another embodiment, Figure 10 As shown in the structure diagram of the service message processing device in an embodiment of the present application, the service message processing device provided by the embodiment of the present application can be applied to any processing node in the service processing system, and a source slave thread in the source application program is deployed on the processing node. Figure 10 As shown, the service message processing device of the embodiment of the present application may include: a message generation module 21 and a message sending module 22, where:

[0205] The message generation module 21 is configured to run the source microservice in the source slave thread and generate the service message of the source application program;

[0206] The message sending module 22 is configured to send the service message to the processing node to which the target slave thread in the destination application program belongs, instruct the processing node to which the target slave thread belongs to run the target microservice in the target slave thread, and process the service message by accessing the quota memory of the target slave thread; the quota memory is pre-applied from the local memory of the processing node to which the target slave thread belongs according to the executable configuration file required during the operation of the destination application program.

[0207] The service message processing device provided by the embodiment of the present application can be used to execute the technical solutions in the above-mentioned embodiment of the service message processing method of the present application. The implementation principle and technical effect are similar, and will not be elaborated here.

[0208] In one of the embodiments, the source application program includes a second process, and the second process includes a main thread and a source slave thread; the service message processing device includes: a source microservice creation module, where:

[0209] The source microservice creation module is configured to create the source microservice in the source slave thread according to the main thread in the second process.

[0210] The service message processing device provided by the embodiment of the present application can be used to execute the technical solutions in the above-mentioned embodiment of the service message processing method of the present application. The implementation principle and technical effect are similar, and will not be elaborated here.

[0211] In one of the embodiments, the source microservice creation module is specifically configured to:

[0212] Run the main thread in the second process to obtain the executable configuration file required during the operation of the source application program;

[0213] Create the source slave thread in the second process according to the executable configuration file required during the operation of the source application program;

[0214] The source slave thread in the second process runs, calls the source microservice interface according to the executable configuration file required during the runtime of the source application, and generates the source microservice.

[0215] The service message processing device provided by the embodiments of the present application can be used to execute the technical solutions in the above embodiments of the service message processing method of the present application. The implementation principles and technical effects are similar and will not be elaborated here.

[0216] In one embodiment, the message sending module 22 includes: an instruction response unit and a message sending unit, where:

[0217] The instruction response unit is configured to respond to the communication instruction of the target microservice, and obtain the connection channel resource between the source slave thread and the target slave thread to which the target microservice belongs according to the communication instruction;

[0218] The message sending unit is configured to send a service message to the processing node to which the target slave thread belongs based on the connection channel corresponding to the connection channel resource.

[0219] The service message processing device provided by the embodiments of the present application can be used to execute the technical solutions in the above embodiments of the service message processing method of the present application. The implementation principles and technical effects are similar and will not be elaborated here.

[0220] In one embodiment, the communication instruction carries a target microservice identifier; the instruction response unit includes: a lookup subunit and a determination subunit, where:

[0221] The lookup subunit is configured to look up the target microservice identifier in the mapping relation table; the mapping relation table includes the corresponding relationship between the identifiers of different microservices and different channel resources;

[0222] The determination subunit is configured to determine the channel resource corresponding to the identifier that matches the target microservice identifier in the mapping relation table as the connection channel resource.

[0223] The service message processing device provided by the embodiments of the present application can be used to execute the technical solutions in the above embodiments of the service message processing method of the present application. The implementation principles and technical effects are similar and will not be elaborated here.

[0224] For the specific limitations on the service message processing device, reference can be made to the limitations on the service message processing method in the foregoing. Details will not be elaborated here. Each module in the above service message processing device can be implemented in whole or in part by software, hardware, and their combination. The above-mentioned modules can be embedded in the processing node in the computer system in hardware form or be independent of it, or can be stored in the memory in the computer system in software form, so as to facilitate the processor to call and execute the operations corresponding to the above modules.

[0225] In one embodiment, a computer system is further provided. The computer system may be a computer device or a server, etc. The internal structure diagram thereof may be as shown in Figure 11 . The computer system includes a processing node, a memory, and a network interface connected through a system bus. Among them, the processing node of the computer system is used to provide processing capabilities. The memory of the computer system includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer system is used to store the service messages of the source application program. The network interface of the computer system is used to communicate with an external endpoint through a network connection. When the computer program is executed by the processing node, it implements a service message processing method.

[0226] Those skilled in the art can understand that Figure 11 the structure shown in is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer system to which the solution of the present application is applied. The specific computer system may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0227] In one embodiment, a computer system is further provided, including a memory and a processing node. A computer program is stored in the memory. When the processing node executes the computer program, it implements the technical solution in the above-mentioned embodiment of the service message processing method of the present application. The implementation principle and technical effect are similar and will not be elaborated here.

[0228] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processing node, it implements the technical solution of the above-mentioned service message processing method of the present application. The implementation principle and technical effect are similar and will not be elaborated here.

[0229] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processing node, it implements the technical solution of the above-mentioned service message processing method of the present application. The implementation principle and technical effect are similar and will not be elaborated here.

[0230] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above various methods. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0231] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0232] The above-described embodiments merely represent several implementation manners of the present application. Their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.

Claims

1. A service message processing method, characterized in that: Applied to any processing node in a business processing system, a target slave thread in a target application program is deployed on the processing node, and the method includes: Get business messages from source applications; Running the target microservice in the target slave thread, and processing the business message by accessing the quota memory of the target slave thread; The quota memory is applied for in advance from the local memory of the processing node according to the executable configuration file required when the target application is running.

2. The method according to claim 1, characterized in that The destination application includes a first process, and the first process includes a main thread and the target slave thread; before obtaining the service message of the source application, the method further includes: According to the main thread in the first process, a target microservice in the target slave thread is created.

3. The method according to claim 2, characterized in that The step of creating a target microservice in the target slave thread according to the main thread in the first process includes: Run the main thread in the first process to obtain an executable configuration file required by the target application when running; Creating a target slave thread in the first process according to an executable configuration file required by the target application when it is running; Run the target slave thread in the first process, call the target microservice interface according to the executable configuration file required when the target application is running, and generate the target microservice.

4. The method according to any one of claims 1 to 3, characterized in that The obtaining of the service message of the source application comprises: Based on the connection channel between the target slave thread and the source slave thread in the source application, the service message sent by the processing node to which the source slave thread belongs is received.

5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: In response to the resource release request of the target slave thread, releasing the quota memory of the target slave thread; and / or, In response to a resource release request of a main thread in the first process, the quota memory of the main thread is released.

6. A service message processing method, characterized in that: Applied to any processing node in a business processing system, on which a source slave thread in a source application is deployed, the method comprises: Running the source microservice in the source slave thread to generate a business message of the source application; The business message is sent to the processing node to which the target slave thread in the destination application belongs, instructing the processing node to which the target slave thread belongs to run the target microservice in the target slave thread, and processing the business message by accessing the quota memory of the target slave thread; the quota memory is applied in advance from the local memory of the processing node to which the target slave thread belongs according to the executable configuration file required when the destination application is running.

7. The method according to claim 6, characterized in that The source application includes a second process, and the second process includes a main thread and a source slave thread; Before running the source microservice, the method further includes: According to the main thread in the second process, a source microservice in the source slave thread is created.

8. The method according to claim 7, characterized in that The step of creating the source microservice in the source slave thread according to the main thread in the second process includes: Running the main thread in the second process to obtain an executable configuration file required by the source application when running; Creating a source slave thread in the second process according to an executable configuration file required by the source application when it is running; The source slave thread in the second process is run, and a source microservice interface is called according to an executable configuration file required when the source application is running, to generate the source microservice.

9. The method according to any one of claims 6 to 8, characterized in that: The sending of the service message to the processing node to which the target slave thread in the destination application belongs includes: In response to a communication instruction of the target microservice, acquiring a connection channel resource between the source slave thread and a target slave thread belonging to the target microservice according to the communication instruction; Based on the connection channel corresponding to the connection channel resource, the service message is sent to the processing node to which the target slave thread belongs.

10. The method according to claim 9, characterized in that The communication instruction carries a target microservice identifier; and obtaining a connection channel resource between the source slave thread and a target slave thread to which the target microservice belongs according to the communication instruction includes: Searching for the target microservice identifier in a mapping relationship table; the mapping relationship table includes the correspondence between identifiers of different microservices and different channel resources; The channel resource corresponding to the identifier matching the target microservice identifier in the mapping relationship table is determined as the connection channel resource.

11. A computer system comprising a memory and a processing node, wherein the memory stores a computer program, characterized in that: When the processing node executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.