[go: up one dir, main page]

CN111131296B - Message distribution method and device - Google Patents

Message distribution method and device Download PDF

Info

Publication number
CN111131296B
CN111131296B CN201911403938.7A CN201911403938A CN111131296B CN 111131296 B CN111131296 B CN 111131296B CN 201911403938 A CN201911403938 A CN 201911403938A CN 111131296 B CN111131296 B CN 111131296B
Authority
CN
China
Prior art keywords
service
message
rpc
identifier
route identifier
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911403938.7A
Other languages
Chinese (zh)
Other versions
CN111131296A (en
Inventor
胡有福
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN201911403938.7A priority Critical patent/CN111131296B/en
Publication of CN111131296A publication Critical patent/CN111131296A/en
Application granted granted Critical
Publication of CN111131296B publication Critical patent/CN111131296B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/133Protocols for remote procedure calls [RPC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a message distribution method and device. The method is applied to a service server and comprises the following steps: registering a first routing identifier corresponding to a first process and a first RPC service provided by the first process to an RPC control center, so that when a service process sends a service message corresponding to the first RPC service, the service message carries the first routing identifier and is sent; registering a second route identifier corresponding to a second process and a second RPC service provided by the second process to an RPC control center, so that when a service process sends a control message corresponding to the second RPC service, the control message carries the second route identifier and is sent; when receiving a service message carrying the first route identifier, processing the service message by operating the first process; and when receiving the control message carrying the second route identifier, processing the control message by operating the second process.

Description

Message distribution method and device
Technical Field
The present application relates to network communication technologies, and in particular, to a method and an apparatus for distributing messages.
Background
In the OpenStack network architecture, before issuing a service message to a service agent process, a Neutron service process issues a control message to determine whether the service agent process operates normally, and when it is determined that the service agent process operates normally, issues the service message to the service agent process, so that the service agent process processes the service message.
In the OpenStack network architecture, a service agent process needs to use a green process to process control messages and business messages. However, the green thread does not have the capability of concurrent processing, which causes the problem that the service agent process cannot process the control message in time when the number of service messages is large, and further causes the service to be affected.
Disclosure of Invention
The application provides a message distribution method and device.
The technical scheme provided by the application comprises the following steps:
according to a first aspect of the present application, there is provided a message distribution method, which is applied to a service server, and includes:
registering a first route identifier corresponding to a first process for processing a service message and running on the equipment and a first RPC service provided by the first process to an RPC control center, so that when the service message corresponding to the first RPC service is sent by the service process, the service message carries the first route identifier and is sent;
registering a second route identifier corresponding to a second process which is operated on the equipment and used for controlling message processing and a second RPC service provided by the second process to an RPC control center, so that when a business service process sends a control message corresponding to the second RPC service, the control message carries the second route identifier and is sent;
when receiving a service message carrying the first route identifier, processing the service message by operating the first process;
and when receiving the control message carrying the second route identifier, processing the control message by operating the second process.
According to a second aspect of the present application, there is provided a message distribution method, which is applied to a service server, and includes:
when a service process issues a service message corresponding to a first RPC service, acquiring a first route identifier corresponding to the first RPC service from an RPC control center, and carrying the first route identifier in the service message;
and when the service process issues a control message corresponding to the second RPC service, acquiring a second route identifier corresponding to the second RPC service from an RPC control center, and carrying the second route identifier in the control message.
According to a third aspect of the present application, there is provided a message distribution apparatus, which is applied to a service server, and includes:
the device comprises a first registration unit, a second registration unit and a third registration unit, wherein the first registration unit is used for registering a first route identifier corresponding to a first process which is operated on the device and used for processing a service message and a first RPC service provided by the first process to an RPC control center, so that when the service message corresponding to the first RPC service is sent by the service process, the first route identifier is carried in the service message and sent;
the second registration unit is used for registering a second route identifier corresponding to a second process which is operated on the equipment and used for controlling message processing and a second RPC service provided by the second process to an RPC control center, so that when a service process sends a control message corresponding to the second RPC service, the control message carries the second route identifier and is sent;
a first processing unit, configured to process, when receiving a service message carrying the first route identifier, the service message by running the first process;
and the second processing unit is used for processing the control message by operating the second process when receiving the control message carrying the second route identifier.
According to a fourth aspect of the present application, there is provided a message distribution apparatus, which is applied to a service server, and includes:
the first issuing unit is used for acquiring a first route identifier corresponding to a first RPC service from an RPC control center when a service process issues a service message corresponding to the first RPC service, and carrying the first route identifier in the service message;
and the second issuing unit is used for acquiring a second route identifier corresponding to the second RPC service from the RPC control center when the service process issues the control message corresponding to the second RPC service, and the control message carries the second route identifier.
According to the technical scheme, the first process used for processing the service message and the second process used for processing the control message are operated on the device, the first routing identification corresponding to the first process is registered to the RPC control center, the second routing identification corresponding to the first process and the second process is registered to the RPC control center, and the service message and the control message can be distributed to the first process and the second process. On the basis, the counting effect that the first process only processes the service messages and the second process only processes the control messages is achieved, even when the number of the service messages needing to be processed by the first process is large, the second process cannot influence the processing of the control messages, and therefore the normal operation of the service is guaranteed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 is an application scenario diagram provided in the present application.
FIG. 2 is a flow chart of a method provided herein;
FIG. 3 is a flowchart of an implementation of step 103 provided herein;
FIG. 4 is a flowchart of an implementation of step 104 provided herein;
FIG. 5 is a flow chart of another method provided herein;
FIG. 6 is a flowchart of an implementation of step 202 provided herein;
FIG. 7 is a schematic diagram of the apparatus provided herein;
fig. 8 is a schematic hardware structure diagram of the apparatus shown in fig. 7 provided in the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Fig. 1 is an application scenario diagram provided in the present application, including: the system comprises a business server which is provided with a Neutron service process, a first process and a second process, and a control server which is provided with a Rabbit service and an RPC control center.
Wherein, the first process is used for processing the service message; the second process is used to control message processing.
The Neutron service is used for respectively sending a service message and a control message to the first process and the second process through the Rabbit service. The control message is an RPC message, and is used to call some functions in the second process and return a call result for indicating whether the second process operates normally, and the Neutron service will issue a service message to the first process when the second process operates normally. The service message is also an RPC message, which is used to call some functions in the first process and return the call result, so as to implement the processing of the service message.
The exchange switch is arranged in the Rabbit service and used for sending the control message to a second service agent process used for processing the control message through the exchange switch and sending the service message to a first service agent process used for processing the service message through the exchange switch.
The RPC control center is used for receiving the registration of the first service agent process, the second service agent process and the Neutron server, so that the first service agent process, the second service agent process and the Neutron server register the RPC provided by the first service agent process, the second service agent process and the Neutron server in the RPC control center.
Based on the application scenario shown in fig. 1, an embodiment of the present application provides a message distribution method. The following describes the flows executed by the first process and the second process, and the business service process, respectively.
The flow executed by the first process and the second process is described with reference to the embodiment shown in fig. 2.
Referring to the embodiment shown in fig. 2, the following process may be included:
step 101, registering a first route identifier corresponding to a first process for processing a service message and running on the equipment and a first RPC service provided by the first process to an RPC control center, so that when the service message corresponding to the first RPC service is sent by the service process, the service message carries the first route identifier and is sent;
as an example, an RPC control center for RPC registration may be set in the network architecture by a user in advance, or an existing RPC control center may be directly used.
As one example, the first RPC service may include a plurality of services. The plurality of services are each a service for processing a traffic message, and each service corresponds to a service function of the first process.
As an example, the first Routing identifier may be a Routing key, so that when the service process carries the Routing key of the first process in a service message, the service message can be sent to the first process.
As an example, after the first process is started, the RPC service and the first route identifier provided by the first process are registered in the RPC control center, so that the business service process can know the service provided by the first process and the first route identifier required when using the service. Taking the application scenario shown in fig. 1 as an example, after the first process is started, the first process registers the service provided by the first process and the corresponding routing key to the RPC control center. When the Neutron service process needs to remotely call a certain function related to service message processing, the RPC control center determines that the first process provides the service and the routing key corresponding to the function, the service message carries the service identifier of the function needing to be remotely called and the routing key and is sent to the rabbitservice, and then the service message is sent to the first process after routing key matching is carried out through the rabbitservice.
Step 102, registering a second route identifier corresponding to a second process which is operated on the equipment and used for controlling message processing and a second RPC service provided by the second process to an RPC control center, so that when a service process sends a control message corresponding to the second RPC service, the control message carries the second route identifier and is sent;
as one example, the second RPC service may include a plurality of services. The plurality of services are each a service for processing a control message, and each service corresponds to a service function of the second process.
As an example, the second Routing identifier may be a Routing key, so that when the traffic service process carries the Routing key of the second process in the control message, the control message can be sent to the second process.
As an example, after the second process is started, the RPC service and the second route identifier provided by the second process are registered in the RPC control center, so that the service provided by the second process and the second route identifier required when using the service can be known by the service process. Taking the application scenario shown in fig. 1 as an example, after the second process is started, the second process registers the service provided by the second process and the corresponding routing key to the RPC control center. When the Neutron service process needs to remotely call a certain function related to control message processing, the RPC control center determines that the second process provides the service and the routing key corresponding to the function, the service identification and the routing key of the function needing to be remotely called are carried in the control message and are sent to the rabbitservice, and then the routing key is matched through the rabbitservice, and the control message is sent to the second process. In particular implementation, the control message may be an rpc.call message for causing the second process to return its own process ID to the Neutron server. When the returned process ID is normal, the second process can be determined to be in a normal running state.
As an example, in order for the traffic message and the control message to be sent to the first process and the second process, respectively, the routing key corresponding to the first process and the routing key corresponding to the second process are different.
As one example, the second process may be a process created by the first process; on this basis, the embodiment of the present application may further include other processes, which will be described in detail below and will not be described herein again.
103, when receiving a service message carrying the first route identifier, processing the service message by operating the first process;
as an example, there are various implementations of processing the service message by running the first process. One of which is shown in fig. 3 and will be described in detail below, and will not be described in detail here.
And 104, when receiving the control message carrying the second route identifier, processing the control message by operating the second process.
As an example, there are various implementations for processing the control message by executing the second process. One of which is shown in fig. 4 and will be described in detail below, and will not be described again here.
Thus, the flow shown in fig. 2 is completed.
According to the technical scheme, the first process used for processing the service message and the second process used for processing the control message are operated on the device, the first routing identification corresponding to the first process is registered to the RPC control center, the second routing identification corresponding to the first process and the second process is registered to the RPC control center, and the service message and the control message can be distributed to the first process and the second process. On the basis, the counting effect that the first process only processes the service messages and the second process only processes the control messages is achieved, even when the number of the service messages needing to be processed by the first process is large, the second process cannot influence the processing of the control messages, and therefore the normal operation of the service is guaranteed.
How step 103 processes the service message by running the first process is described below with reference to the flow shown in fig. 3. As shown in fig. 3, the following process may be included:
step 1031, obtaining a first service identifier from the service message by running the first process;
as an example, the first process may register a service message handler in the process in advance, where the service message handler is a function name set including a plurality of service functions related to service message handling. Each function herein may correspond to a first RPC service registered with the RPC control center.
As one example, the first service identification may be a function name of a service function.
Step 1032, the first process is executed to invoke a service function corresponding to the first service identifier according to the first service identifier to process the service message.
As an example, after obtaining the first service identifier in the service message, a service function corresponding to the first service identifier may be searched, and the function may be called to process the service message. And obtaining a response processing result after the processing is finished, and returning the processing result to the business service process. In specific implementation, the function name of the service function matched with the first service identifier may be searched in the service message processing handler, and then the service function corresponding to the function name is called to process the service message.
This completes the description of the embodiment shown in fig. 3.
How step 104 processes the control message by running the second process is described below with reference to the flowchart shown in fig. 4. As shown in fig. 4, the following process may be included:
step 1041, acquiring a first service identifier from the service message by running the first process;
as an example, the second process may register a control message handler in the process in advance, where the control message handler is a function name set including a plurality of service functions related to control message handling. Each function herein may correspond to a second RPC service registered with the RPC control center.
As an example, the second service identification may be a function name of the service function.
Step 1042, by running the first process, a service function corresponding to the first service identifier is called according to the first service identifier to process the service message.
As an example, after obtaining the second service identifier in the control message, a service function corresponding to the second service identifier may be looked up and called to process the control message. And obtaining a response processing result after the processing is finished, and returning the processing result to the control server. In specific implementation, the function name of the service function matched with the second service identifier may be searched in the control message processing handler, and the service function corresponding to the function name may be called to process the control message.
This completes the description of the embodiment shown in fig. 4.
In order to enable the business service process to know that the second process operates normally, the second process periodically sends a keep-alive message to the business service process, so that the business service process determines that the second process operates normally according to the keep-alive message.
As one example, the second process may send an RPC message to the business service process to invoke a certain function in the business service process. And the business service process can record the time for calling the function when calling the function each time, so as to be used as the time point when the second process operates normally at last. When the business service process does not update the time point for a long time, the business service process can determine that the second process is abnormally operated.
The following describes a flow that can be executed when the second process is a process created by the first process:
105, when the second process is detected to be abnormal, recovering the second process through the first process, and recreating a process as the second process;
as an example, the first process may monitor the operational status of the second process. For example, the second process periodically sends a message carrying the running state of the second process to the first process, and when the first process does not receive the message carrying the running state of the second process sent by the second process within a certain time period, it may be determined that the second process is abnormal.
As an example, once the second process is detected to be abnormal, the second process may be reclaimed and a process may be recreated as the second process to ensure normal processing of the control message.
And 106, controlling the second process to stop running when the first process is detected to be abnormal.
As one example, a first process may establish a pipe with a second process. The first process can be used as a write end after the pipeline is established, and the second process can be used as a read end. The first process will not transmit messages through the pipe when it is running normally, so the second process will find the pipe to be in a blocking state when it reads the pipe. However, when the first process abnormally ends, it causes the pipe to change from the blocked state to the readable state. Thus, the second process may detect the first process exception by checking the pipe state.
As an example, when the second process detects that the first process is abnormal, an end message for indicating to end the process may be generated and stopped according to the end message.
So far, the description of how the first process and the second process finish running is completed.
When the second process is a process created by the first process, the embodiment of the present application may further perform the following steps in addition to the above step 104 and step 105:
step 106, the second process reads the resource descriptor inheriting the first process;
as an example, since the second process was created by the first process. Thus, the second process will process the resource descriptor of the first process.
Step 107, the second process selects a specified file descriptor from the resource descriptor, and prohibits the second process from accessing the file corresponding to the file descriptor; the file descriptor is a descriptor corresponding to a file causing the access conflict between the second process and the first process.
As an example, since the second process handles a different type of message than the first process. Therefore, in order to avoid the file descriptors of the second process and the first process from conflicting, and further cause an exception to occur in the operation of the second process and the first process, the second process needs to close the descriptor corresponding to the file which can cause the access conflict between the second process and the first process.
As an example, the second process would first add all the resource descriptors to the fds _ list file list. Thereafter, the log file descriptor, the pipe file descriptor, the 0 (standard input) file descriptor, the 1 (standard output) file descriptor, and the 2 (standard error output) file descriptor are identified from the fds _ list and added to the reserved _ fds reserved file list. By means of the fds _ list and the reserved _ fds list, the file descriptors except the reserved _ fds list are found in the fds _ list, and the files corresponding to the file descriptors are prohibited.
So far, the description of how the second process prohibits the access to the file corresponding to the specified file descriptor is completed.
The above is a description of the flow executed by the first process and the second process.
The following describes the flow executed by the business service process with reference to the embodiment shown in fig. 5.
As one example, the business service process may be a Neutron service process in the OpenStack network architecture.
Referring to the embodiment shown in fig. 5, the following process may be included:
step 201, when a service process issues a service message corresponding to a first RPC service, acquiring a first route identifier corresponding to the first RPC service from an RPC control center, and carrying the first route identifier in the service message;
as an example, a business service process may issue a business message corresponding to the first RPC service when some business needs to be processed.
As an example, reference may be made to the foregoing description of the network device side for the contents of the first RPC service and the first route identifier, which are not described herein again.
Step 202, when a service process issues a control message corresponding to a second RPC service, a second route identifier corresponding to the second RPC service is obtained from an RPC control center, and the control message carries the second route identifier.
As an example, there are various implementations for carrying the second route identification in the control message. One of which is shown in fig. 6 and described in detail below, and will not be described again here.
This completes the description of the embodiment shown in fig. 5.
In the following, how to carry the second routing identity in the control message in step 202 is described with reference to the embodiment shown in fig. 6. As shown in fig. 6, the following process may be included:
step 2021, checking whether a keep-alive message carrying a second route identifier has been received within a current or previous set time; if yes, go to step 2022; if not, go to step 2023;
as an example, the flow executed in this step may refer to the foregoing description of the content related to the keep-alive message, which is not repeated here.
Step 2022, carrying the second route identifier in the control message.
As an example, if the keep-alive message carrying the second route identifier has been received within the current or previous set time, which indicates that the second process operates normally, the control message carrying the second route identifier may be issued to the second process.
Step 2023, obtaining other route identifiers corresponding to the first RPC service from the RPC control center.
As an example, if the keep-alive message carrying the second route identifier is not received within the current or previous set time, which indicates that the second process is running abnormally, the second process of one other network device needs to be determined again, and the control message is issued to the second process.
This completes the description of the embodiment shown in fig. 6.
Corresponding to the foregoing embodiments of the message distribution method applied to the service server, the present application also provides embodiments of a message distribution apparatus applied to the service server.
The embodiment of the message distribution device can be applied to a service server. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a device in a logical sense, the device is formed by reading a corresponding computer program instruction in a nonvolatile memory into an internal memory through a processor of a service server where the device is located to operate. In terms of hardware, as shown in fig. 8, the hardware structure diagram of the service server where the message distribution apparatus of the present application is located is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 8, the network device where the apparatus is located in the embodiment may also include other hardware according to the actual function of the service server, which is not described again.
Referring to fig. 7, fig. 7 is a device structure diagram of a message distribution device according to the present application. The device is applied to a business server and comprises:
a first registration unit 710, configured to register a first route identifier corresponding to a first process used for processing a service message and running on the device and a first RPC service provided by the first process to an RPC control center, so that when a service message corresponding to the first RPC service is sent by a service process, the service message carries the first route identifier and is sent;
a second registration unit 720, configured to register a second route identifier corresponding to a second process running on the device and used for controlling message processing and a second RPC service provided by the second process to an RPC control center, so that when a service process sends a control message corresponding to the second RPC service, the service process carries the second route identifier in the control message and sends the control message;
a first processing unit 730, configured to, when receiving a service message carrying the first route identifier, process the service message by running the first process;
the second processing unit 740 is configured to, when receiving the control message carrying the second route identifier, process the control message by operating the second process.
This completes the description of the apparatus shown in fig. 7.
As an example, the service message carries a first service identifier; the first processing unit 730 is specifically configured to obtain a first service identifier from the service message by running the first process; and calling a service function corresponding to the first service identifier to process the service message according to the first service identifier by running the first process.
As an example, the control message carries a second service identifier; the second processing unit 740 is specifically configured to obtain a second service identifier from the control message by running the second process; and calling a service function corresponding to the second service identifier according to the second service identifier by running the second process to process the service message.
As one example, the second process is a process created by the first process; the apparatus further comprises: a process control unit (not shown in the figure) for recovering the second process through the first process and recreating a process as the second process when the second process is detected to be abnormal; and when the first process is detected to be abnormal, controlling the second process to stop running.
As an example, the apparatus further comprises: a prohibiting unit (not shown in the figure) for reading the resource descriptor of the inherited first process; selecting a specified file descriptor from the resource descriptor, and prohibiting the second process from accessing a file corresponding to the file descriptor; the file descriptor is a descriptor corresponding to a file causing the access conflict between the second process and the first process.
As an example, the apparatus further comprises: a keep-alive unit (not shown in the figure), configured to send a keep-alive message to the service process by running a second process, so that the service process determines that the second process runs normally according to the keep-alive message.
Referring to fig. 8, fig. 8 is a hardware structure diagram of a network device where a message distribution apparatus of the present application is located, where the hardware structure includes: a processor and a memory.
Wherein the memory is used for storing machine executable instructions;
a processor configured to read and execute the machine executable instructions stored in the memory to implement the cloud management service access method as shown in fig. 2.
For one embodiment, the memory may be any electronic, magnetic, optical, or other physical storage device that may contain or store information such as executable instructions, data, and the like. For example, the memory may be: volatile memory, non-volatile memory, or similar storage media. In particular, the Memory may be a RAM (random Access Memory), a flash Memory, a storage drive (e.g., a hard disk drive), a solid state disk, any type of storage disk (e.g., an optical disk, a DVD, etc.), or similar storage medium, or a combination thereof.
So far, the description of the apparatus shown in fig. 8 is completed.
Corresponding to the foregoing embodiment of the message distribution method applied to the service server, the present application also provides another embodiment of a message distribution apparatus applied to the service server.
The message distribution device applied to the service server comprises:
the first issuing unit is used for acquiring a first route identifier corresponding to a first RPC service from an RPC control center when a service process issues a service message corresponding to the first RPC service, and carrying the first route identifier in the service message;
and the second issuing unit is used for acquiring a second route identifier corresponding to the second RPC service from the RPC control center when the service process issues the control message corresponding to the second RPC service, and the control message carries the second route identifier.
As an example, the second issuing unit is specifically configured to check whether a keep-alive message carrying the second route identifier has been received within current or current previous set time; and if so, carrying a second route identifier in the control message.
So far, the description of the message distribution apparatus applied to the service server is completed.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (10)

1. A message distribution method is applied to a service server and comprises the following steps:
registering a first route identifier corresponding to a first process for processing a service message and running on the equipment and a first RPC service provided by the first process to an RPC control center, so that when the service message corresponding to the first RPC service is sent by the service process, the service message carries the first route identifier and is sent; the service message is an RPC message and is used for calling some functions in the first process and returning a calling result so as to realize the processing of the service message;
registering a second route identifier corresponding to a second process which is operated on the equipment and used for controlling message processing and a second RPC service provided by the second process to an RPC control center, so that when a business service process sends a control message corresponding to the second RPC service, the control message carries the second route identifier and is sent; the control message is an RPC message and is used for calling some functions in the second process and returning a calling result for indicating whether the second process operates normally, and the Neutron service can issue a service message to the first process when the second process operates normally;
when receiving a service message carrying the first route identifier, processing the service message by operating the first process;
and when receiving the control message carrying the second route identifier, processing the control message by operating the second process.
2. The method of claim 1, wherein the service message carries a first service identifier;
when receiving a service message carrying the first route identifier, processing the service message by running the first process includes:
acquiring a first service identifier from the service message by running the first process;
and calling a service function corresponding to the first service identifier to process the service message according to the first service identifier by running the first process.
3. The method of claim 1, wherein the control message carries a second service identifier;
when receiving a control message carrying the second route identifier, processing the control message by operating the second process includes:
acquiring a second service identifier from the control message by operating the second process;
and calling a service function corresponding to the second service identifier according to the second service identifier by running the second process to process the control message.
4. The method of claim 1, wherein the second process is a process created by the first process;
the method further comprises the following steps:
when the second process is detected to be abnormal, recovering the second process through the first process, and recreating one process as the second process;
and when the first process is detected to be abnormal, controlling the second process to stop running.
5. The method of claim 4, further comprising:
reading a resource descriptor inheriting a first process;
selecting a specified file descriptor from the resource descriptor, and prohibiting the second process from accessing a file corresponding to the file descriptor; the file descriptor is a descriptor corresponding to a file causing the access conflict between the second process and the first process.
6. The method of claim 1, further comprising:
and sending a keep-alive message to the business service process by operating a second process, so that the business service process determines that the second process operates normally according to the keep-alive message.
7. The method of claim 1, wherein carrying the second routing identity in the control message comprises:
checking whether a keep-alive message carrying a second route identifier is received within the current or current preset time;
and if so, carrying a second route identifier in the control message.
8. A message distribution method is applied to a service server and comprises the following steps:
when a service process issues a service message corresponding to a first RPC service, acquiring a first route identifier corresponding to the first RPC service from an RPC control center, and carrying the first route identifier in the service message; the service message is an RPC message and is used for calling some functions in the first process and returning a calling result so as to realize the processing of the service message;
when the business service process issues the control message corresponding to the second RPC service, the second route identifier corresponding to the second RPC service is acquired from the RPC control center, and the control message carries the second route identifier, wherein the control message is an RPC message and is used for calling certain functions in the second process and returning a calling result used for indicating whether the second process operates normally, and the Neutron service can issue the business message to the first process when the second process operates normally.
9. A message distribution apparatus, applied to a service server, comprising:
the device comprises a first registration unit, a second registration unit and a third registration unit, wherein the first registration unit is used for registering a first route identifier corresponding to a first process which is operated on the device and used for processing a service message and a first RPC service provided by the first process to an RPC control center, so that when the service message corresponding to the first RPC service is sent by the service process, the first route identifier is carried in the service message and sent; the service message is an RPC message and is used for calling some functions in the first process and returning a calling result so as to realize the processing of the service message;
the second registration unit is used for registering a second route identifier corresponding to a second process which is operated on the equipment and used for controlling message processing and a second RPC service provided by the second process to an RPC control center, so that when a service process sends a control message corresponding to the second RPC service, the control message carries the second route identifier and is sent; the control message is an RPC message and is used for calling some functions in the second process and returning a calling result for indicating whether the second process operates normally, and the Neutron service can issue a service message to the first process when the second process operates normally;
a first processing unit, configured to process, when receiving a service message carrying the first route identifier, the service message by running the first process;
and the second processing unit is used for processing the control message by operating the second process when receiving the control message carrying the second route identifier.
10. A message distribution apparatus, wherein the apparatus is applied to a service server, and comprises:
the first issuing unit is used for acquiring a first route identifier corresponding to a first RPC service from an RPC control center when a service process issues a service message corresponding to the first RPC service, and carrying the first route identifier in the service message; the service message is an RPC message and is used for calling some functions in the first process and returning a calling result so as to realize the processing of the service message;
the second issuing unit is used for acquiring a second routing identifier corresponding to a second RPC service from an RPC control center when a business service process issues the control message corresponding to the second RPC service, and the control message carries the second routing identifier; the control message is an RPC message and is used for calling some functions in the second process and returning a calling result for indicating whether the second process operates normally, and the Neutron service can issue a service message to the first process when the second process operates normally.
CN201911403938.7A 2019-12-30 2019-12-30 Message distribution method and device Active CN111131296B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911403938.7A CN111131296B (en) 2019-12-30 2019-12-30 Message distribution method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911403938.7A CN111131296B (en) 2019-12-30 2019-12-30 Message distribution method and device

Publications (2)

Publication Number Publication Date
CN111131296A CN111131296A (en) 2020-05-08
CN111131296B true CN111131296B (en) 2022-04-26

Family

ID=70505913

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911403938.7A Active CN111131296B (en) 2019-12-30 2019-12-30 Message distribution method and device

Country Status (1)

Country Link
CN (1) CN111131296B (en)

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9240965B2 (en) * 2010-08-31 2016-01-19 Sap Se Methods and systems for business interaction monitoring for networked business process
CN108733698B (en) * 2017-04-19 2023-08-08 腾讯科技(深圳)有限公司 Log message processing method and background service system
CN109729596B (en) * 2017-10-27 2021-01-29 华为技术有限公司 Data sending and receiving method and equipment
CN109976886B (en) * 2017-12-28 2021-10-22 深圳中电长城信息安全系统有限公司 Kernel remote switching method and device
CN107948215A (en) * 2018-01-17 2018-04-20 广州汇智通信技术有限公司 A kind of remote invocation method and device based on UDP communications
CN108347445B (en) * 2018-03-19 2021-04-27 武汉斗鱼网络科技有限公司 Method and device for realizing remote calling
CN109032767B (en) * 2018-07-26 2021-04-02 苏州科达科技股份有限公司 Asynchronous multi-process business processing system, method, device and storage medium

Also Published As

Publication number Publication date
CN111131296A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
US12095621B2 (en) Managed remediation of non-compliant resources
CN109873804A (en) Behavior-based service identification method, apparatus, device, and readable storage medium
CN109714239B (en) Management message issuing method, VNFM (virtual network management frequency) equipment and server
CN112328363B (en) Cloud hard disk mounting method and device
CN111367887A (en) Multi-tenant data sharing system, management method thereof and database deployment method
CN111061685B (en) Log query method and device, node equipment and storage medium
US20170063862A1 (en) System and method for authentication
CN110851207A (en) State transition management method and device, electronic equipment and computer readable storage medium
US11709750B2 (en) Dynamically mapping software infrastructure utilization
CN109558249B (en) Control method and device for concurrent operation
CN111162947B (en) PCRE hot switching method, network device and storage medium
CN117650937A (en) Task permission verification method and device, nonvolatile storage medium and electronic equipment
CN111131296B (en) Message distribution method and device
CN105183799A (en) Authority management method and client
CN117793034B (en) Network card adding method, device, computing device and machine-readable storage medium
CN110780944B (en) Method, device and machine-readable storage medium for starting application authority
CN112733499A (en) Serial number generation method and device
US12210640B1 (en) System, method, and computer program for managing sensitive local data for a global application in compliance with local data residency requirements
JP6564067B2 (en) Service management method and apparatus
CN117251181A (en) Vehicle software integration method, device and computer-readable storage medium
CN115686746A (en) Access method, task processing method, computing device, and computer storage medium
CN106022171A (en) External storage device access control method and device for Android terminal
CN115103020B (en) Data migration processing method and device
US20250310332A1 (en) Resource protection for a microservice-based application
US20240095148A1 (en) Automatic assignment of changed permissions for diagnostic purposes for work container instances that have already been started

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant