CN109918215B - Process communication method, system, terminal and storage medium - Google Patents

Process communication method, system, terminal and storage medium Download PDF

Info

Publication number
CN109918215B
CN109918215B CN201910164392.8A CN201910164392A CN109918215B CN 109918215 B CN109918215 B CN 109918215B CN 201910164392 A CN201910164392 A CN 201910164392A CN 109918215 B CN109918215 B CN 109918215B
Authority
CN
China
Prior art keywords
parameter information
process parameter
information
changed
parameter
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
CN201910164392.8A
Other languages
Chinese (zh)
Other versions
CN109918215A (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.)
Shanghai United Imaging Healthcare Co Ltd
Original Assignee
Shanghai United Imaging Healthcare 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 Shanghai United Imaging Healthcare Co Ltd filed Critical Shanghai United Imaging Healthcare Co Ltd
Priority to CN201910164392.8A priority Critical patent/CN109918215B/en
Publication of CN109918215A publication Critical patent/CN109918215A/en
Application granted granted Critical
Publication of CN109918215B publication Critical patent/CN109918215B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the invention discloses a process communication method, a system, a terminal and a storage medium, wherein the method comprises the following steps: when the first process detects that at least one first process parameter information changes, traversing second process parameter information corresponding to at least one second process stored in the memory dictionary according to the changed first process parameter information; the first process determines a target second process corresponding to the changed first process parameter information, and sends the changed first process parameter information to the corresponding target second process. By the technical scheme of the embodiment of the invention, redundant message notification can be avoided, so that communication burden is reduced, and operation efficiency is improved.

Description

Process communication method, system, terminal and storage medium
Technical Field
Embodiments of the present invention relate to computer technologies, and in particular, to a process communication method, a system, a terminal, and a storage medium.
Background
With the development of computer technology, technicians develop more and more software to meet the increasing demands of people. Typically, software is a software system composed of a plurality of processes, and the processes coordinate with each other through frequent communications.
Currently, when a certain process needs to notify some parameter information to other processes, a broadcast message manner is often adopted to realize inter-process communication. As shown in fig. 1, the process a broadcasts some parameter information by using a broadcast message manner, and the process B, the process C and the process D register the message channel of the process a in advance to receive the broadcast message. When any parameter information of the process A changes, the process A broadcasts the changed parameter information to all registered processes, so that the process B, the process C and the process D can obtain the changed parameter information.
However, in the process of implementing the present invention, the inventors found that at least the following problems exist in the prior art:
when the process a needs to broadcast a plurality of parameter information, such as parameter 1, parameter 2, parameter 3, parameter 4, and parameter 5, the process B needs to obtain only parameter 1, the process C needs to obtain only parameter 2 and parameter 3, the process D needs to obtain only parameter 1 and parameter 5, and so on. At this time, if the communication is performed by broadcasting the message, the process B receives, in addition to the parameter 1 required by itself, the rest of unnecessary parameter information broadcasted by the process a, such as parameter 2, parameter 3, parameter 4 and parameter 5. It can be seen that these redundant message notifications greatly increase the system communication burden and reduce the system operation efficiency.
Disclosure of Invention
The embodiment of the invention provides a process communication method, a system, a terminal and a storage medium, which are used for avoiding redundant message notification, thereby reducing communication burden and improving operation efficiency.
In a first aspect, an embodiment of the present invention provides a process communication method, including:
when the first process detects that at least one first process parameter information changes, traversing second process parameter information corresponding to at least one second process stored in the memory dictionary according to the changed first process parameter information;
the first process determines a target second process corresponding to the changed first process parameter information, and sends the changed first process parameter information to the corresponding target second process.
In a second aspect, an embodiment of the present invention further provides a process communication system, where the system includes: a first process and at least one second process;
wherein the first process is for: when at least one first process parameter information is detected to change, traversing second process parameter information corresponding to at least one second process stored in the memory dictionary according to the changed first process parameter information; and determining a target second process corresponding to the changed first process parameter information, and sending the changed first process parameter information to the corresponding target second process.
In a third aspect, an embodiment of the present invention further provides a terminal, where the terminal includes:
one or more processors;
a memory for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the process communication methods as provided by any of the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a process communication method as provided by any of the embodiments of the present invention.
According to the embodiment of the invention, the second process parameter information corresponding to at least one second process is stored in the memory dictionary maintained by the first process in advance, the first process is responsible for detecting whether the first process parameter information in the system changes or not, and when the change of the at least one first process parameter information is detected, the second process parameter information corresponding to each second process stored in the memory dictionary is traversed, and the target second process corresponding to the changed first process parameter information is determined, namely, the changed first process parameter information is the parameter information required by the target second process, so that the changed first process parameter information can be only sent to the corresponding target second process and is not required to be sent to other second processes, redundant information notification in the system can be avoided, unnecessary parameter information is avoided from being received by other second processes, communication burden is further reduced, and the operation efficiency of the system is improved.
Drawings
FIG. 1 is a flow chart of a prior art process communication method;
FIG. 2 is a flow chart of a process communication method according to a first embodiment of the present invention;
FIG. 3 is a flowchart of a process communication method according to a second embodiment of the present invention;
FIG. 4 is a flowchart of a process communication method applied to a mobile C-arm software system according to a second embodiment of the present invention;
fig. 5 is a schematic structural diagram of a process communication system according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of a terminal according to a fourth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 2 is a flowchart of a process communication method provided in an embodiment of the present invention, where the embodiment is applicable to a situation where processes in a software system communicate with each other, and particularly, may be used in a situation where processes in a medical software system communicate with each other, where the medical software system may be a mobile C-arm software system. The method may be performed by a process communication system, which may be implemented in software and/or hardware, integrated in a terminal of a loadable software system, such as a computer, a personal notebook, a mobile phone, a game console, etc. As shown in fig. 2, the method specifically includes the following steps:
And S110, when the first process detects that at least one first process parameter information changes, traversing second process parameter information corresponding to at least one second process stored in the memory dictionary according to the changed first process parameter information.
The first process may be a process for monitoring whether the parameter information of each first process in the whole system changes. The first process parameter information may refer to various parameter information in the entire system that the first process is responsible for monitoring. Illustratively, the first process parameter information may be, but is not limited to, resource usage information and/or system state information, wherein the resource usage information may include, but is not limited to, CPU (Central Processing Unit ) utilization and/or disk space, etc.; the system state information may include, but is not limited to, network connection state information, and the like.
The second process may refer to a process in the system for receiving the message notification sent by the first process, and in particular, may refer to a process for implementing a corresponding specific function by using the second process parameter information. The second process parameter information may refer to one or more first process parameter information in the system required for the second process to run. Illustratively, it is assumed that the first process a is responsible for monitoring five first process parameter information in the system, respectively: when the second process B is running, only the parameter 1 and the parameter 5 need to be utilized, the second process parameter information corresponding to the second process B is the parameter 1 and the parameter 5, that is, the parameter 1 and the parameter 5 are the parameter information necessary for the second process B, and the parameter 2, the parameter 3 and the parameter 4 are the parameter information unnecessary for the second process B.
The memory dictionary may refer to a thread-safe dictionary maintained in the first process for storing second process parameter information corresponding to one or more second processes. The data storage type of the memory dictionary in this embodiment may be, but is not limited to, a key pair type, so as to facilitate storage and query of data. The memory dictionary may be used to store key value pair information corresponding to at least one second process, where key information in the key value pair information is a second process identifier of a string type corresponding to the second process; the value information in the key value pair information is second process parameter information of a set list type corresponding to the second process. Wherein the second process identification may be composed of at least one of numbers, letters, chinese characters, symbols, and graphics for uniquely identifying the second process so as to distinguish the different second processes. For example, the in-memory dictionary may be defined as: concurrentdictionary < string, list < SystemStatusType > -registered Map, wherein registered Map is the name of the memory dictionary, and key information string is the second process identifier of string type; the value information List < SystemStatusType > is a set composed of the respective second process parameter information SystemStatusType.
Specifically, in this embodiment, the second process parameter information corresponding to each second process may be stored in advance in a memory dictionary maintained by the first process, so that the first process performs data query. The first process can detect whether each first process parameter information changes in real time or periodically, and when at least one first process parameter information is detected to change, the first process can traverse each second process parameter information corresponding to each second process stored in the memory dictionary according to each changed first process parameter information, that is, parameter matching is performed on each changed first process parameter information and each second process parameter information stored in the memory dictionary, so as to determine whether the changed first process parameter information and the second process parameter information in the memory dictionary belong to the same parameter.
S120, the first process determines a target second process corresponding to the changed first process parameter information, and sends the changed first process parameter information to the corresponding target second process.
The target second process may refer to a second process corresponding to when the changed parameter information of the first process is the parameter information required by the first process. The first process parameter information that changes in this embodiment may be one or more. When a plurality of changed first process parameter information exists, determining a target second process corresponding to each changed first process parameter information.
Specifically, for each first process parameter information which changes, parameter matching is performed on the first process parameter information which changes and each second process parameter information in the memory dictionary, whether the first process parameter information which changes and the second process parameter information in the memory dictionary belong to the same parameter is determined, and a target second process corresponding to the first process parameter information which changes is determined according to a matching result. For example, if the second process parameter information corresponding to a certain second process in the memory dictionary and the changed first process parameter information belong to the same parameter, the matching is successful, that is, the changed first process parameter information is the parameter information required by the second process, and at this time, the second process can be determined as the target second process corresponding to the changed first process parameter information. Similarly, one or more target second processes corresponding to the changed first process parameter information can be determined.
For example, if the first process a is responsible for monitoring five pieces of first process parameter information in the system, the pieces of first process parameter information are respectively: parameter 1, parameter 2, parameter 3, parameter 4 and parameter 5, the second process parameter information corresponding to the second process B is parameter 1 and parameter 5, the second process parameter information corresponding to the second process C is parameter 1 and parameter 4, and when the first process a detects that the parameter 1 changes, it can determine that the target second process corresponding to the changed parameter 1 is second process B and second process C; when the first process a detects that the parameter 5 changes, it can be determined that the target second process corresponding to the changed parameter 1 is only the second process B. When the first process a detects that the parameter 1 and the parameter 5 change simultaneously, it can be determined that the target second processes corresponding to the changed parameter 1 and the changed parameter 5 are both the second process B.
After determining the target second process corresponding to the changed first process parameter information, the first process can send each changed first process parameter information to the corresponding target second process at fixed points through a point-to-point sending command, so that redundant information notification in the system can be avoided, the rest second processes are prevented from receiving unnecessary parameter information, communication burden is further reduced, and the running efficiency of the system is improved. It should be noted that, the fixed point communication method in this embodiment is different from the fixed point communication method in the prior art, and the difference is that: in the fixed-point communication mode in the prior art, a communication protocol between a first process and a second process is established in advance based on second process parameter information corresponding to the second process, so that the first process sends a message notification to the second process based on the communication protocol. However, when the parameter information of the second process corresponding to the second process is changed due to a service requirement or the like, the first process may send unnecessary parameter information of the second process to the second process based on a pre-established communication protocol, which may also cause redundant message notification. In this embodiment, a communication protocol is not required to be established in advance, only the target second process corresponding to the changed first process parameter information is required to be determined according to the memory dictionary maintained by the first process, and the current second process parameter information corresponding to each second process may be stored in the memory dictionary, so that the target second process may be accurately determined according to the memory dictionary, so that the changed first process parameter information is sent to the corresponding target second process, and further, redundant message notification may be avoided.
According to the technical scheme, the second process parameter information corresponding to at least one second process is stored in the memory dictionary maintained by the first process in advance, the first process is responsible for detecting whether the first process parameter information in the system changes or not, when the change of the at least one first process parameter information is detected, the second process parameter information corresponding to each second process stored in the memory dictionary is traversed, the target second process corresponding to the changed first process parameter information is determined, namely, the changed first process parameter information is the parameter information required by the target second process, so that the changed first process parameter information can be only sent to the corresponding target second process without being sent to other second processes, redundant information notification in the system can be avoided, unnecessary parameter information is prevented from being received by other second processes, communication burden is further reduced, and the running efficiency of the system is improved.
On the basis of the above technical solution, when the memory dictionary is used for storing key value pair information corresponding to each second process, the "traversing second process parameter information corresponding to at least one second process stored in the memory dictionary according to changed first process parameter information" in S110 includes: traversing the second process parameter information in each value information stored in the memory dictionary, and performing parameter matching on the traversed second process parameter information and the changed first process parameter information.
Specifically, each piece of value information stored in the memory dictionary is second process parameter information corresponding to the second process. The embodiment can traverse each second process parameter information in each value information, perform parameter matching on the traversed second process parameter information and the changed first process parameter information, determine whether the traversed second process parameter information and the changed first process parameter information belong to the same parameter, if so, indicate that the parameter matching is successful, and if not, indicate that the parameter matching is failed.
For example, the second process parameter information stored in each value in the memory dictionary may be a second process parameter identifier corresponding to the second process, where the second process parameter identifier may be a name of the second process parameter, or may be at least one of a number, a letter, a Chinese character, a symbol, and a graphic, and is used to partition different second process parameters. Correspondingly, the embodiment can perform identification matching on each second process parameter identification in each value information and the changed first process parameter identification, if the identifications are the same, the two are the same parameters, at this time, the success of parameter matching can be determined, otherwise, the failure of parameter matching is determined.
Accordingly, the "determining the target second process corresponding to the changed first process parameter information" in S120 includes: determining target value information corresponding to second process parameter information successfully matched with the changed first process parameter information; and determining target key information according to the memory dictionary and the target value information, and determining a target second process corresponding to the changed first process parameter information according to the target key information.
Specifically, for each value information in the memory dictionary, if the second process parameter information in a certain value information is successfully matched with the changed first process parameter information parameter, the value information can be determined to be the target value information corresponding to the changed first process parameter information, and the target key information corresponding to the target value information can be determined according to the corresponding relation between the key information and the value information in the memory dictionary. And obtaining a second process identifier according to the target key information, so that a second process corresponding to the second process identifier can be determined to be a target second process corresponding to the changed first process parameter information. Similarly, all target second processes corresponding to the changed first process parameter information can be determined.
Based on the above technical solution, before S110, the method further includes: when the first process receives second process parameter information corresponding to the second process, the first process detects whether a second process identifier corresponding to the received second process exists in the memory dictionary; and if the second process identifier does not exist in the memory dictionary, storing the received second process identifier corresponding to the second process and second process parameter information into the memory dictionary.
Specifically, the second process may send second process parameter information corresponding to the second process to the first process according to the service requirement and the actual situation. Illustratively, during the system initialization phase, each second process in the system sends its own second process parameter information to the first process. When the second process parameter information of a certain second process is changed, the second process can send the changed second process parameter information to the first process. When the first process receives second process parameter information corresponding to the second process, the first process can traverse each second process identifier currently stored in the memory dictionary, match the currently stored second process identifier with the second process identifier corresponding to the received second process, and determine whether the second process is stored in the memory dictionary at the current moment. If all second process identifiers stored in the memory dictionary currently are failed to be matched with the second process identifiers corresponding to the received second process, the fact that the second process identifiers corresponding to the received second process do not exist in the memory dictionary is indicated, and at the moment, the second process identifiers corresponding to the received second process and second process parameter information can be stored in the memory dictionary through a preset storage Add function, so that the first process can accurately communicate with the second process based on the memory dictionary.
Based on the technical scheme, the method further comprises the following steps: if the second process identifier exists in the memory dictionary, matching the historical second process parameter information corresponding to the second process identifier in the memory dictionary with the current second process parameter information received currently; if the matching of the historical second process parameter information and the current second process parameter information fails, updating the historical second process parameter information into the current second process parameter information.
Specifically, if the matching of a certain second process identifier stored in the memory dictionary with a second process identifier corresponding to a received second process is successful, it indicates that the second process identifier corresponding to the received second process exists in the memory dictionary, that is, second process parameter information corresponding to the second process is already stored in the memory dictionary, at this time, the second process parameter information corresponding to the second process stored in the memory dictionary may be used as historical second process parameter information corresponding to the second process, and the second process parameter information corresponding to the second process received currently is used as current second process parameter information corresponding to the second process. By matching each historical second process parameter information with each current second process parameter information, if the historical second process parameter information is the same as the current second process parameter information, and the number of the historical second process parameter information is equal to the number of the current second process parameter information, the fact that the second process parameter information corresponding to the second process is unchanged is indicated, and at the moment, the memory dictionary can be not required to be updated. If the historical second process parameter information is different from the current second process parameter information and/or the number of the historical second process parameter information is not equal to the number of the current second process parameter information, a failure in matching is indicated, namely the second process parameter information corresponding to the second process is changed, at the moment, the historical second process parameter information in the memory dictionary can be updated to be the current second process parameter information, so that the second process parameter information in the memory dictionary is dynamically stored, the first process can communicate according to the current second process parameter information of the second process, the accuracy of communication is ensured, and redundant information notification is further avoided.
Example two
Fig. 3 is a flowchart of a process communication method according to a second embodiment of the present invention, where the "the first process receives the second process parameter information corresponding to the second process" is further optimized based on the foregoing embodiment. Wherein the same or corresponding terms as those of the above-described embodiments are not explained in detail herein.
Referring to fig. 3, the process communication method provided in this embodiment specifically includes the following steps:
s210, the second process uses a process parameter object corresponding to the second process as a function input parameter, calls a process registration function in a preset interface of the first process, and registers the process parameter object in the first process.
The preset interface may be a preset registration interface provided by the first process, so that the second process may register second process parameter information corresponding to the second process to the first process through the preset interface. The process parameter objects corresponding to the second process are objects which are preset by the second process, of a preset interface type and are used for storing second process parameter information corresponding to the second process. The process registration function may be a function predefined in a preset interface for registering a process parameter object into the first process. Illustratively, the process registration function may be defined as: registerStatusType (SystemStatusTypeInfosystemStatusTypeInfo); the register status type is the name of the process registration function, and the systemstatus type info is a process parameter object corresponding to a second process of the preset interface type systemstatus type info.
Illustratively, the process registration function may implement the function of registering a process parameter object into a first process by: initializing a first parameter set object in a preset interface according to second process parameter information in the process parameter object; serializing the initialized first parameter set object to obtain a second parameter set object, and sending the second parameter set object to the first process.
The first parameter set object may be a set object predefined in the pre-interface and used for storing first process parameter information corresponding to the first process. That is, each element information in the first parameter set object is each first process parameter information corresponding to the first process.
Specifically, after the second process uses the process parameter object corresponding to the second process as a function input parameter and invokes the process registration function in the preset interface of the first process, initializing, namely instantiating, the first parameter set object according to the second process parameter information in the process parameter object. That is, the initialized first parameter set object stores second process parameter information in the process parameter object. And serializing the initial first parameter set object so as to encapsulate the initial first parameter set object into a second parameter set object conforming to a transmission format, so that the second parameter set object is transmitted to the first process, and data transmission is realized.
S220, the first process analyzes the registered process parameter object to obtain second process parameter information corresponding to the second process.
Specifically, the embodiment may analyze the process parameter object registered to the first process, so as to obtain second process parameter information corresponding to the second process stored in the process parameter object.
Illustratively, upon receiving the second parameter set object transmitted by the second process registration, S220 may include: the first process deserializes the second set of parameter objects to obtain second process parameter information corresponding to the second process. Specifically, the first process performs deserialization and data analysis on the second set of parameter objects, so that the first process can obtain second process parameter information corresponding to the second process stored in the second set of parameter objects.
When a plurality of second processes exist, the process parameter object corresponding to each second process can be registered into the first process by calling the process registration function in the preset interface of the first process, so that the first process can receive the second process parameter information sent by each second process. When the second process parameter information corresponding to a certain second process changes, the second process calls a process registration function in the preset interface again, and the corresponding process parameter object is registered in the first process.
S230, the first process detects whether a second process identifier corresponding to the obtained second process exists in the memory dictionary; and if the second process identifier does not exist in the memory dictionary, storing the received second process identifier corresponding to the second process and second process parameter information into the memory dictionary.
And S240, when the first process detects that at least one first process parameter information changes, traversing second process parameter information corresponding to at least one second process stored in the memory dictionary according to the changed first process parameter information.
S250, the first process determines a target second process corresponding to the changed first process parameter information, and sends the changed first process parameter information to the corresponding target second process.
According to the technical scheme, the second process registers the process parameter object corresponding to the second process in the first process in a mode of calling the process registration function in the preset interface of the first process, so that the first process can acquire the second process parameter information corresponding to the second process more quickly and conveniently, and the running efficiency of the system is further improved.
Based on the above technical solutions, fig. 4 shows a flowchart of a process communication method applied to a mobile C-arm software system. As shown in fig. 4, a system state management process in the mobile C-arm software system is taken as a first process, and the rest processes in the system are taken as a second process, wherein parameter information corresponding to the system state management process can include, but is not limited to, disk space, network connection, bulb temperature, UPS (Uninterruptible Power System, uninterruptible power supply) power, C-arm connection, a shutdown command from a hardware module, and the like.
The process of process communication in a C-arm software system is illustrated in fig. 4 by way of example with a system state management process a and three second processes B, C and D. The specific process communication process is as follows: the second processes B, C and D call a process registration function in a preset interface of the system state management process A, register second process parameter information corresponding to the second process into the preset interface, namely the second process B registers second process parameter information 1 required by the second process B by calling the process registration function in the preset interface; the second process C registers second process parameter information 2 required by itself by calling a process registration function in a preset interface; the second process D registers the second process parameter information 3 required by itself by calling a process registration function in a preset interface. The preset interface sequences the set objects corresponding to the registered second process parameter information 1, 2 and 3 respectively and then sends the command to the system state management process A, the system state management process A analyzes the received command to obtain second process parameter information corresponding to the second process B, C and D respectively, and when the second process identifiers corresponding to the second process B, C and D are detected to be absent in the memory dictionary, the second process identifiers B, C and D and the second process parameter information 1, 2 and 3 are stored in the memory dictionary. When the system state management process A detects that at least one parameter information in the C-type arm software system changes, the system state management process A determines a second process corresponding to the changed parameter information according to the memory dictionary, for example, if the second process parameter information 1 changes, the changed second process parameter information 1 is packaged and then a command is sent in a point-to-point mode, and the changed second process parameter information 1 is sent to the second process B; similarly, when the second process parameter information 2 changes, a command is sent to the second process C to send the changed second process parameter information 2 to the second process C. And when the second process parameter information 3 changes, sending a command to the second process D so as to send the changed second process parameter information 3 to the second process D. Therefore, the parameter information received by each second process can be ensured to be the parameter information required by the second process, and redundant message notification is avoided.
The following is an embodiment of a process communication system provided by an embodiment of the present invention, which belongs to the same inventive concept as the process communication method of the above embodiments, and reference may be made to the embodiment of the process communication method for details that are not described in detail in the embodiment of the process communication system.
Example III
Fig. 5 is a schematic structural diagram of a process communication system according to a third embodiment of the present invention, where the present embodiment is applicable to a case of communication between processes in a software system, and the system includes: a first process 310 and at least one second process 320;
wherein the first process 310 is configured to: when detecting that at least one first process parameter information changes, traversing second process parameter information corresponding to at least one second process 320 stored in the memory dictionary according to the changed first process parameter information; and determining a target second process corresponding to the changed first process parameter information, and sending the changed first process parameter information to the corresponding target second process.
Optionally, the first process 310 is further configured to: before the first process detects that at least one first process parameter information changes, when the first process receives second process parameter information corresponding to a second process, detecting whether a second process identifier corresponding to the received second process exists in the memory dictionary; and if the second process identifier does not exist in the memory dictionary, storing the received second process identifier corresponding to the second process and second process parameter information into the memory dictionary.
Optionally, the second process 320 is configured to: taking a process parameter object corresponding to a second process as a function input parameter, calling a process registration function in a preset interface of the first process, and registering the process parameter object into the first process, wherein the process parameter object is used for storing second process parameter information corresponding to the second process; accordingly, the first process 310 is also for: and analyzing the registered process parameter object to obtain second process parameter information corresponding to the second process.
Optionally, the process registration function implements a function of registering a process parameter object into the first process by:
initializing a first parameter set object in a preset interface according to second process parameter information in the process parameter object; serializing the initialized first parameter set object to obtain a second parameter set object, and sending the second parameter set object to the first process;
accordingly, the first process 310 is also for: the first process deserializes the second set of parameter objects to obtain second process parameter information corresponding to the second process.
Optionally, the first process 310 is further configured to: if the second process identifier exists in the memory dictionary, matching the historical second process parameter information corresponding to the second process identifier in the memory dictionary with the current second process parameter information received currently; if the matching of the historical second process parameter information and the current second process parameter information fails, updating the historical second process parameter information into the current second process parameter information.
Optionally, the memory dictionary is configured to store key value pair information corresponding to at least one second process, where key information in the key value pair information is a second process identifier of a character string type corresponding to the second process; the value information in the key value pair information is second process parameter information of a set type corresponding to the second process.
Optionally, the first process 310 is specifically configured to: traversing the second process parameter information in each value information stored in the memory dictionary, and performing parameter matching on the traversed second process parameter information and the changed first process parameter information; determining target value information corresponding to second process parameter information successfully matched with the changed first process parameter information; and determining target key information according to the memory dictionary and the target value information, and determining a target second process corresponding to the changed first process parameter information according to the target key information.
According to the process communication system provided by the embodiment of the invention, the second process parameter information corresponding to at least one second process is stored in the memory dictionary maintained by the first process in advance through the first process, the first process is responsible for detecting whether each first process parameter information in the system changes, and when the change of at least one first process parameter information is detected, traversing the second process parameter information corresponding to each second process stored in the memory dictionary, and determining the target second process corresponding to the changed first process parameter information, namely, the changed first process parameter information is the parameter information required by the target second process, so that the changed first process parameter information is only transmitted to the corresponding target second process and is not required to be transmitted to other second processes, redundant information notification in the system is avoided, unnecessary parameter information is avoided from being received by other second processes, communication burden is further reduced, and the running efficiency of the system is improved.
Example IV
Fig. 6 is a schematic structural diagram of a terminal according to a fourth embodiment of the present invention. Referring to fig. 6, the terminal includes:
one or more processors 410;
a memory 420 for storing one or more programs;
when the one or more programs are executed by the one or more processors 410, the one or more processors 410 are caused to implement the process communication method as provided in any of the above embodiments, the method comprising:
when the first process detects that at least one first process parameter information changes, traversing second process parameter information corresponding to at least one second process stored in the memory dictionary according to the changed first process parameter information;
the first process determines a target second process corresponding to the changed first process parameter information, and sends the changed first process parameter information to the corresponding target second process.
Examples are; the processor 410 and the memory 420 in the terminal may be connected by a bus or otherwise, for example in fig. 6.
The memory 420 is a computer readable storage medium, and may be used to store a software program, a computer executable program, and modules, such as program instructions corresponding to the process communication method in the embodiment of the present invention. The processor 410 executes various functional applications of the terminal and data processing, i.e., implements the above-described process communication method, by running software programs and instructions stored in the memory 420.
The memory 420 mainly includes a memory program area and a memory data area, wherein the memory program area can store an operating system, at least one application program required for functions; the storage data area may store data created according to the use of the terminal, etc. In addition, memory 420 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, memory 420 may further include memory located remotely from processor 410, which may be connected to the terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The terminal provided in this embodiment belongs to the same inventive concept as the process communication method provided in the above embodiment, and technical details not described in detail in this embodiment can be seen in the above embodiment, and this embodiment has the same advantages of executing the process communication method.
Example five
The present embodiment provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a process communication method as provided by any embodiment of the present invention, the method comprising:
When the first process detects that at least one first process parameter information changes, traversing second process parameter information corresponding to at least one second process stored in the memory dictionary according to the changed first process parameter information;
the first process determines a target second process corresponding to the changed first process parameter information, and sends the changed first process parameter information to the corresponding target second process.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
It will be appreciated by those of ordinary skill in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be centralized on a single computing device, or distributed over a network of computing devices, or they may alternatively be implemented in program code executable by a computer device, such that they are stored in a memory device and executed by the computing device, or they may be separately fabricated as individual integrated circuit modules, or multiple modules or steps within them may be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (9)

1. A process communication method, comprising:
when the first process detects that at least one first process parameter information changes, traversing second process parameter information corresponding to at least one second process stored in a memory dictionary according to the changed first process parameter information, wherein the memory dictionary is used for storing key value pair information corresponding to at least one second process, and key information in the key value pair information is a second process identifier of a character string type corresponding to the second process; the value information in the key value pair information is second process parameter information of the set type corresponding to the second process;
the first process determines a target second process corresponding to the changed first process parameter information, and sends the changed first process parameter information to the corresponding target second process at fixed points through a point-to-point sending command.
2. The method of claim 1, wherein prior to the first process detecting a change in at least one first process parameter information, further comprising:
when the first process receives second process parameter information corresponding to a second process, the first process detects whether a second process identifier corresponding to the received second process exists in the memory dictionary;
And if the second process identifier does not exist in the memory dictionary, storing the received second process identifier corresponding to the second process and second process parameter information into the memory dictionary.
3. The method of claim 2, wherein the first process receiving second process parameter information corresponding to the second process comprises:
the second process takes a process parameter object corresponding to the second process as a function input parameter, calls a process registration function in a preset interface of the first process, and registers the process parameter object into the first process, wherein the process parameter object is used for storing second process parameter information corresponding to the second process;
and the first process analyzes the registered process parameter object to obtain second process parameter information corresponding to the second process.
4. A method according to claim 3, wherein the process registration function implements the function of registering the process parameter object into the first process by:
initializing a first parameter set object in the preset interface according to second process parameter information in the process parameter object;
Serializing the initialized first parameter set object to obtain a second parameter set object, and sending the second parameter set object to the first process;
correspondingly, the first process analyzes the registered process parameter object to obtain second process parameter information corresponding to the second process, which comprises the following steps:
and the first process deserializes the second parameter set object to obtain second process parameter information corresponding to the second process.
5. The method as recited in claim 2, further comprising:
if the second process identifier exists in the memory dictionary, matching historical second process parameter information corresponding to the second process identifier in the memory dictionary with current second process parameter information received currently;
and if the matching of the historical second process parameter information and the current second process parameter information fails, updating the historical second process parameter information into the current second process parameter information.
6. The method of claim 1, wherein traversing the second process parameter information corresponding to the at least one second process stored in the memory dictionary based on the changed first process parameter information comprises:
Traversing the second process parameter information in each value information stored in the memory dictionary, and performing parameter matching on the traversed second process parameter information and the changed first process parameter information;
correspondingly, determining the target second process corresponding to the changed first process parameter information comprises the following steps:
determining target value information corresponding to second process parameter information successfully matched with the changed first process parameter information;
and determining target key information according to the memory dictionary and the target value information, and determining a target second process corresponding to the changed first process parameter information according to the target key information.
7. A process communication system, the system comprising: a first process and at least one second process;
wherein the first process is for: traversing second process parameter information corresponding to at least one second process stored in a memory dictionary according to the changed first process parameter information when the change of at least one first process parameter information is detected, wherein the memory dictionary is used for storing key value pair information corresponding to at least one second process, and the key information in the key value pair information is a second process identifier of a character string type corresponding to the second process; the value information in the key value pair information is second process parameter information of the set type corresponding to the second process; and determining a target second process corresponding to the changed first process parameter information, and sending the changed first process parameter information to the corresponding target second process at fixed points through a point-to-point sending command.
8. A terminal, the terminal comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, causes the one or more processors to implement the process communication method of any of claims 1-6.
9. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the process communication method according to any of claims 1-6.
CN201910164392.8A 2019-03-05 2019-03-05 Process communication method, system, terminal and storage medium Active CN109918215B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910164392.8A CN109918215B (en) 2019-03-05 2019-03-05 Process communication method, system, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910164392.8A CN109918215B (en) 2019-03-05 2019-03-05 Process communication method, system, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN109918215A CN109918215A (en) 2019-06-21
CN109918215B true CN109918215B (en) 2023-06-30

Family

ID=66963430

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910164392.8A Active CN109918215B (en) 2019-03-05 2019-03-05 Process communication method, system, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN109918215B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988706A (en) * 2021-03-09 2021-06-18 广州小鹏汽车科技有限公司 Data management method and device and electronic controller

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE69530731D1 (en) * 1994-07-22 2003-06-18 Sun Microsystems Inc Method and device for space efficient communication between processes
US7519918B2 (en) * 2002-05-30 2009-04-14 Intel Corporation Mobile virtual desktop
CN101354695B (en) * 2008-09-19 2010-07-21 杭州华三通信技术有限公司 Method, system and distributed apparatus of communication between processes
CN105446853A (en) * 2015-11-03 2016-03-30 深圳市金立通信设备有限公司 Application management method and terminal
US20170279657A1 (en) * 2016-03-22 2017-09-28 International Business Machines Corporation Communicating between components in business process management systems

Also Published As

Publication number Publication date
CN109918215A (en) 2019-06-21

Similar Documents

Publication Publication Date Title
CN109213611B (en) Cross-process communication method, device, terminal and storage medium
KR20110076954A (en) Optimized polling in low resource devices
CN111459954A (en) Distributed data synchronization method, device, equipment and medium
US11237888B2 (en) Message processing method and system, storage medium and electronic device
WO2020168893A1 (en) Name label display method and apparatus
KR20130108613A (en) Method and device for interprocess communication and computer storage medium
CN104936282A (en) Method and device for registering converged communication service
CN110740145A (en) Message consumption method, device, storage medium and electronic equipment
CN110457132B (en) Method and device for creating functional object and terminal equipment
CN109918215B (en) Process communication method, system, terminal and storage medium
CN109787789B (en) Compatibility management method, device and equipment for software upgrading and storage medium
US10958726B2 (en) Method of synchronizing device list in a smart network system, apparatus, and computer storage medium thereof
CN116881040A (en) Service operation processing method and device, electronic device and storage medium
CN112948138A (en) Method and device for processing message
CN113127775A (en) Page loading method, device, equipment and storage medium
CN115412993A (en) Relay discovery method, system, device and storage medium
CN113220342A (en) Centralized configuration method and device, electronic equipment and storage medium
CN109656659B (en) Behavior event processing method and device, electronic equipment and readable storage medium
CN109426572B (en) Task processing method and device and electronic equipment
CN112711602A (en) Running method and device of storage process, database system and storage medium
CN113904980B (en) Channel switching method, device, switch and storage medium
CN113542043B (en) Data sampling method, device, equipment and medium of network equipment
WO2024098938A1 (en) Fault detection and disaster recovery method for network function repository function, and related device
CN108617027B (en) Software design method for GPRS multichannel communication of intelligent electric meter
US20150199406A1 (en) Method and device for filtering system events, terminal, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 201807 Shanghai City, north of the city of Jiading District Road No. 2258

Applicant after: Shanghai Lianying Medical Technology Co.,Ltd.

Address before: 201807 Shanghai City, north of the city of Jiading District Road No. 2258

Applicant before: SHANGHAI UNITED IMAGING HEALTHCARE Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant