CN113076131A - Embedded software system construction method and system based on multi-process architecture idea - Google Patents

Embedded software system construction method and system based on multi-process architecture idea Download PDF

Info

Publication number
CN113076131A
CN113076131A CN202110370919.XA CN202110370919A CN113076131A CN 113076131 A CN113076131 A CN 113076131A CN 202110370919 A CN202110370919 A CN 202110370919A CN 113076131 A CN113076131 A CN 113076131A
Authority
CN
China
Prior art keywords
business logic
agent
starting
agent process
interactive information
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.)
Pending
Application number
CN202110370919.XA
Other languages
Chinese (zh)
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.)
Shandon Aitopo Software Development Co ltd
Shandong Energy Group Co Ltd
Original Assignee
Shandon Aitopo Software Development Co ltd
Shandong Energy Group 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 Shandon Aitopo Software Development Co ltd, Shandong Energy Group Co Ltd filed Critical Shandon Aitopo Software Development Co ltd
Priority to CN202110370919.XA priority Critical patent/CN113076131A/en
Publication of CN113076131A publication Critical patent/CN113076131A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Mathematical Physics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to a method and a system for constructing an embedded software system based on a multi-process architecture idea. The method comprises the following steps: acquiring an actual service scene, and constructing one or more service logic processes according to the actual service scene; constructing a proxy process according to the actual service scene and compiling a proxy process configuration file; configuring an application program self-starting item in an operating system, so that the agent process is automatically started after the operating system is started, and restarting the operating system; automatically starting the agent process, wherein the agent process starts the business logic process according to the agent process configuration file; and the agent process enters a daemon state and a message forwarding state of the business logic process to construct a multi-process software system. The invention is not affected by the crash of the single service logic process, improves the operation efficiency of the service logic process and enables the performance of the service logic process to be exerted to the maximum value.

Description

Embedded software system construction method and system based on multi-process architecture idea
Technical Field
The invention relates to the field of embedded software system construction, in particular to an embedded software system construction method and system based on a multi-process architecture idea.
Background
The embedded system is generally applied to the field of industrial control, and because the application scenes are different and the hardware performance of the embedded system is generally lower than that of the traditional computer system, the application program running on the embedded system is required to have both high performance and high stability, and the stability of the application program is more important under most conditions.
At present, a complex application program is compiled in an embedded system environment, a multithreading architecture is mostly adopted, a traditional development idea is that one business logic module occupies one thread to form application software of the multithreading architecture with multiple functions, one business logic module has one function, and all functions among the multiple business logic modules are mutually called, so that the software architecture has the following defects:
a business logic module crash (thread) can cause the whole application to crash, which ultimately affects the production work of the user and causes economic loss.
Multiple business logic modules (threads) share system resources (e.g., memory) of a process, so that the performance of each business logic module (thread) is greatly limited.
Disclosure of Invention
The invention aims to provide a method and a system for constructing an embedded software system based on a multi-process architecture idea, which aim to solve the problems that when the conventional software architecture adopts a multi-thread architecture, the whole application program is crashed due to the crash of one service logic module, and a plurality of service logic modules share the system resources of one process, so that the performance of each service logic module is greatly limited.
In order to achieve the purpose, the invention provides the following scheme:
a method for constructing an embedded software system based on a multi-process architecture idea comprises the following steps:
acquiring an actual service scene, and constructing one or more service logic processes according to the actual service scene; each business logic process comprises a plurality of functions; the multiple functions comprise a parameter receiving and starting function, a parameter analyzing and starting function, an interactive information channel establishing function, an interactive information sending function and an interactive information analyzing function; the business logic processes are independent from each other;
constructing a proxy process according to the actual service scene and compiling a proxy process configuration file; the agent process configuration file comprises a business logic process name, a starting parameter, a business logic process daemon rule and a message forwarding rule;
configuring an application program self-starting item in an operating system, so that the agent process is automatically started after the operating system is started, and restarting the operating system;
automatically starting the agent process, wherein the agent process starts the business logic process according to the agent process configuration file;
and the agent process enters a daemon state and a message forwarding state of the business logic process to construct a multi-process software system.
Optionally, the automatically starting the proxy process, where the proxy process starts the service logic process according to the proxy process configuration file, and then the method further includes:
starting one or more business logic processes by using the agent process, or using the agent process to defend one or more business logic processes;
processing the interactive information sent to the agent process by the service logic process by using the agent process;
and forwarding the interactive information among the plurality of business logic processes by utilizing the agent process.
Optionally, the starting of one or more business logic processes by using the agent process, or the daemon of one or more business logic processes by using the agent process specifically includes:
reading the agent process configuration file by using the agent process, and constructing a service logic process structure list; the business logic process structure body list comprises a plurality of business logic process structure bodies; the business logic process structure body is internally stored with a business logic process name, a starting parameter, a business logic process daemon rule and an association table of the business logic process and an interactive information name;
sequentially starting the service logic processes under the appointed path according to the service logic process structure list, transmitting the starting parameters corresponding to the service logic processes under the appointed path to the service logic processes, and constructing an interactive information channel between the agent process and the service logic processes;
and under the support of the operating system, based on the interactive information channel, utilizing the agent process to monitor the running state of the business logic process in real time.
Optionally, the monitoring, with the support of the operating system, the running state of the business logic process in real time by using the agent process based on the interaction information channel, and then further includes:
after any business logic process exits, searching a business logic process daemon rule corresponding to the exited business logic process from the business logic process structure list by using the agent process;
judging whether the exited business logic process needs to be guarded or not according to the business logic process guarding rule;
if yes, restarting the business logic process by using the agent process;
if not, the proxy process does not do any processing.
An embedded software system construction system based on multi-process architecture idea comprises:
the service logic process construction module is used for acquiring an actual service scene and constructing one or more service logic processes according to the actual service scene; each business logic process comprises a plurality of functions; the multiple functions comprise a parameter receiving and starting function, a parameter analyzing and starting function, an interactive information channel establishing function, an interactive information sending function and an interactive information analyzing function; the business logic processes are independent from each other;
the agent process construction and agent process configuration file compiling module is used for constructing an agent process and compiling an agent process configuration file according to the actual service scene; the agent process configuration file comprises a business logic process name, a starting parameter, a business logic process daemon rule and a message forwarding rule;
the self-starting item configuration module is used for configuring an application program self-starting item in an operating system, so that the agent process is automatically started after the operating system is started, and the operating system is restarted;
the agent process starting module is used for automatically starting the agent process, and the agent process starts the business logic process according to the agent process configuration file;
and the multi-process software system construction module is used for enabling the agent process to enter a daemon state and a message forwarding state of the business logic process so as to construct a multi-process software system.
Optionally, the method further includes:
the business logic process starting/guarding module is used for starting one or more business logic processes by utilizing the agent process or guarding one or more business logic processes by utilizing the agent process;
the interactive information processing module is used for processing the interactive information sent to the agent process by the service logic process by using the agent process;
and the interactive information forwarding module is used for forwarding the interactive information among the service logic processes by utilizing the agent process.
Optionally, the service logic process starting/guarding module specifically includes:
the business logic process structure list constructing unit is used for reading the agent process configuration file by using the agent process and constructing a business logic process structure list; the business logic process structure body list comprises a plurality of business logic process structure bodies; the business logic process structure body is internally stored with a business logic process name, a starting parameter, a business logic process daemon rule and an association table of the business logic process and an interactive information name;
an interactive information channel construction unit, configured to sequentially start service logic processes in an assigned path according to the service logic process structure list, transmit start parameters corresponding to the service logic processes in the assigned path to the service logic processes, and construct an interactive information channel between the agent process and the service logic processes;
and the monitoring unit is used for monitoring the running state of the business logic process in real time by utilizing the agent process based on the interactive information channel under the support of the operating system.
Optionally, the method further includes:
the searching unit is used for searching a service logic process daemon rule corresponding to the exited service logic process from the service logic process structure list by using the agent process after any service logic process exits;
the judging unit is used for judging whether the exited business logic process needs to be guarded or not according to the business logic process guarding rule;
the starting unit is used for restarting the business logic process by utilizing the agent process when the exited business logic process needs to be guarded;
and the step returning unit is used for not performing any processing by the agent process when the exited service logic process does not need to be guarded.
According to the specific embodiment provided by the invention, the invention discloses the following technical effects: the invention provides a method and a system for constructing an embedded software system based on a multi-process architecture idea, constructing one or more business logic processes according to the actual business scenario, each business logic process comprising a plurality of functions, the multiple functions comprise a parameter receiving and starting function, a parameter analyzing and starting function, an interactive information channel establishing function, an interactive information sending function and an interactive information analyzing function, one business logic process occupies one process, the business logic processes are independent, even if one service logic process crashes, the operation of the whole application program is not influenced, and because each service logic process is independent, the system resources of the same process do not need to be shared, each process independently shares 4G memory space, the memory is more, the program performance is enhanced, so that the performance of the service logic process is exerted to the maximum value; and constructing an agent process according to the actual service scene and compiling an agent process configuration file, wherein the agent process monitors the running state of the service logic process in real time based on the agent process configuration file, so that the service logic process is timely guarded. The invention replans the traditional application software with a multi-functional multi-thread architecture to construct a multi-process architecture software system consisting of an agent process and one or more business logic processes, thereby effectively improving the running efficiency of the business logic processes.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a flow chart of a method for constructing an embedded software system based on a multi-process architecture idea, according to the present invention;
fig. 2 is a structural diagram of a system for constructing an embedded software system based on the idea of multi-process architecture provided by the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention aims to provide a method and a system for constructing an embedded software system based on a multi-process architecture idea, which are not affected by the crash of a single business logic process, improve the running efficiency of the business logic process and enable the performance of the business logic process to be exerted to the maximum.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Abbreviations and key terms in the present invention are defined as follows:
an embedded system: the embedded system is composed of hardware and software, and is a device capable of independently operating.
And (4) process: the program in the computer is a basic unit for resource allocation and scheduling of a system with respect to one-time operation activity on a certain data set, and is the basis of an operating system structure.
Thread: the minimum unit of operation scheduling that the operating system can perform is included in the process, and is the actual operation unit in the process.
QT technology: in 1991, a cross-platform C + + graphical user interface application development framework developed by the fancy technology.
JSON: a lightweight data exchange format.
Agent: and (4) proxy process.
And (2) Worker: and (4) business logic process.
Msg: and (5) interactive messages between the Agent and the Worker.
UDP: the Internet protocol suite supports a connectionless transport protocol known as the user datagram protocol.
SOCKET: abstraction of endpoints for bi-directional communication between application processes on different hosts in a network.
Fig. 1 is a flowchart of a method for constructing an embedded software system based on a multi-process architecture idea, as shown in fig. 1, the method for constructing an embedded software system based on a multi-process architecture idea includes:
step 101: acquiring an actual service scene, and constructing one or more service logic processes according to the actual service scene; each business logic process comprises a plurality of functions; the multiple functions comprise a parameter receiving and starting function, a parameter analyzing and starting function, an interactive information channel establishing function, an interactive information sending function and an interactive information analyzing function; the business logic processes are independent from each other.
The business logic process refers to an application program (for example, reading keyboard input) for completing one or more specific works, different workers need to be built in different business scenes, and the business logic process can have a visual user interface or no user interface.
The Worker has the following capabilities after being constructed:
the capability to receive and analyze the startup parameters delivered by the Agent.
Has the capability of establishing an Msg tunnel with an Agent.
Has the capability of sending Msg to an Agent.
Has the ability to receive the Msg from the Agent and analyze this Msg.
Msg is a short string (utf-8 encoded) and individual messages are preferably controlled to within 2048 bytes, conforming to the JSON specification. The basic format of each message is a JSONOBJECT type (data type in JSON specification), and the format is fixed, so that uniform analysis is facilitated, and the specific format is as follows: { "msgname": xxx, yyy: yyy } } if there is no message content, also complies with the above format requirements, for example: { "msgname": this is one of the simplest message contents that meets the JSON specification requirements.
Step 102: constructing a proxy process according to the actual service scene and compiling a proxy process configuration file; the agent process configuration file comprises a business logic process name, a starting parameter, a business logic process daemon rule and a message forwarding rule.
The agent process is responsible for the starting and guarding (program crash restart) of one or more Workers; and processing the Msg sent by the Worker to the Agent or forwarding the Msg among the workers, thereby realizing communication among different workers and management on the workers.
The agent process is developed by adopting QT technology, can realize cross-platform (window platform and linux platform), and does not need repeated coding. The embedded system automatically starts the agent process after starting (by configuring the starting parameters of the operating system or configuring the agent process as a daemon process).
The Agent configuration file comprises information such as a Worker name, a starting parameter, a Worker guard rule, a message forwarding rule and the like, and the file content conforms to the JSON specification.
For example:
Figure BDA0003009272130000081
procname: the name of Worker.
guard: and (5) a daemon rule, 0: not daemon, 1: daemon (the Agent is responsible for restarting the process).
cmd: and starting parameters.
auto: when 0: the agent process is started, the process is not started, and when 1: the agent process is started, the process is automatically started.
spmsg: this Worker is responsible for the list of accepted message names. Note that: there may be multiple processes for a message.
Step 103: and configuring an application program self-starting item in the operating system, so that the agent process is automatically started after the operating system is started, and restarting the operating system.
Step 104: and automatically starting the agent process, wherein the agent process starts the business logic process according to the agent process configuration file.
The step 104 further includes: starting one or more business logic processes by using the agent process, or using the agent process to defend one or more business logic processes; processing the interactive information sent to the agent process by the service logic process by using the agent process; and forwarding the interactive information among the plurality of business logic processes by utilizing the agent process.
The starting of one or more business logic processes by using the agent process or the daemon of one or more business logic processes by using the agent process specifically includes: reading the agent process configuration file by using the agent process, and constructing a service logic process structure list; the business logic process structure body list comprises a plurality of business logic process structure bodies; the business logic process structure body is internally stored with a business logic process name, a starting parameter, a business logic process daemon rule and an association table of the business logic process and an interactive information name; sequentially starting the service logic processes under the appointed path according to the service logic process structure list, transmitting the starting parameters corresponding to the service logic processes under the appointed path to the service logic processes, and constructing an interactive information channel between the agent process and the service logic processes; and under the support of the operating system, based on the interactive information channel, utilizing the agent process to monitor the running state of the business logic process in real time.
Starting and guarding about Worker:
after the Agent is started, the Agent configuration file is read, and one or more specified Worker is started according to the rule specified in the configuration file. The Worker exists as a child process of the Agent, the Agent as a parent process can sense the state of the child process (which is supported by an operating system), so that the Agent can sense the state after the Worker exits, the Worker can be restarted, and the guard function is realized.
The monitoring of the running state of the business logic process in real time by using the agent process based on the interaction information channel under the support of the operating system further comprises:
after any business logic process exits, searching a business logic process daemon rule corresponding to the exited business logic process from the business logic process structure list by using the agent process;
judging whether the exited business logic process needs to be guarded or not according to the business logic process guarding rule;
if yes, restarting the business logic process by using the agent process;
if not, the proxy process does not do any processing.
The startup and daemon process of the Worker will be explained next:
(1) the Agent reads the configuration file, a Worker structure body list is established in the memory, and the name, the starting parameter, the guard rule, the correlation table of the Worker and the Msg name and the like of the Worker are stored in the structure body.
(2) And the Agent sequentially starts the Worker under the specified path according to the Worker structure body list and transmits the relevant starting parameters to the Worker.
(3) And finishing the establishment of the Msg channel between the Agent and the Worker.
(4) Under the support of an operating system, the Agent can monitor the running state of the Worker in real time.
When a certain Worker exits, the Agent can immediately sense the Worker, at the moment, a corresponding protection rule is searched from a Worker structure list, if protection is needed, the Agent restarts the Worker, and the execution is started from the step (2); if no daemon is needed, no processing is done.
The forwarding of the interaction information among the plurality of business logic processes by using the agent process specifically includes:
after the Agent is started, the Agent configuration file is read, the Msg name which can be processed by a Worker is obtained, and an association table of the Worker and the Msg name is established; meanwhile, a SOCKET of local UDP is established, an idle port number is randomly bound, Msg sent by a Worker is monitored in real time, the port number is transmitted to the Worker in a starting parameter mode, the Worker informs the Agent of the port number of the UDP of the Worker in the Msg mode after starting, and therefore the Msg channel between the Agent and the Worker is well established.
After the Msg tunnel is successfully established, the Agent can forward the message, and the process is as follows:
worker1 sends Msg1 named xxx.
The Msg1 is sent to the Agent through the established Msg tunnel.
And searching a Worker and Msg name association table in the memory by the Agent, and finding a Worker2, a Worker3 and the like capable of processing the Msg 1.
Preprocessing is carried out on the Msg1, for example, when the Worker2 is not started, the Worker2 is started according to the starting rule of the Worker2 (refer to a Worker starting and guarding flow).
The Msg1 is forwarded to the Worker through the pre-established Msg tunnel of the Agent, the Worker2, the Worker3 and the like.
Step 105: and the agent process enters a daemon state and a message forwarding state of the business logic process to construct a multi-process software system.
After the Agent, the Worker and the Agent configuration document are constructed, deployment must be carried out according to a specified path.
Take the example of a Linux system:
# define GB _ AI _ ROOT/home/orangepi/ait runtime environment ROOT directory (for example)
GB _ AI _ ROOT/clientagent proxy process path
GB _ AI _ ROOT/worker1/worker1 worker1 path
GB _ AI _ ROOT/worker2/worker2 worker2 path
And the Agent starts a homonymous process from the operator name to the homonymous directory under the running environment root directory.
In summary, the construction method of the present invention is applied to practice, and the specific steps are as follows:
(1) and constructing one or more Works according to the actual service scene plan.
(2) And compiling an Agent configuration file according to the actual service scene.
(3) And (5) carrying out system release, namely, after the Agent, the Worker and the Agent configuration file are constructed, deploying according to a specified path. The Agent, the Worker and the Agent configuration file are deployed according to a specified path, and the path of the Agent is 'GB _ AI _ ROOT/client'; the Agent configuration file and the Agent are under the same directory; for example, the path of the business logic process named "work 1" is "GB _ AI _ ROOT/worker1/worker 1".
(4) And configuring an application program self-starting item of the operating system, so that the Agent can be automatically started after the operating system is started.
(5) The operating system is restarted.
(6) The Agent is automatically started.
(7) And the Agent starts a Worker according to the content of the Agent configuration file.
(8) The Agent enters a Worker guard state and a message forwarding state.
(9) And completing the construction of the multi-process software system.
Fig. 2 is a structural diagram of an embedded software system construction system based on a multi-process architecture idea provided by the present invention, and as shown in fig. 2, the embedded software system construction system based on the multi-process architecture idea includes:
a service logic process construction module 201, configured to obtain an actual service scene, and construct one or more service logic processes according to the actual service scene; each business logic process comprises a plurality of functions; the multiple functions comprise a parameter receiving and starting function, a parameter analyzing and starting function, an interactive information channel establishing function, an interactive information sending function and an interactive information analyzing function; the business logic processes are independent from each other.
The agent process construction and agent process configuration file compiling module 202 is used for constructing an agent process and compiling an agent process configuration file according to the actual service scene; the agent process configuration file comprises a business logic process name, a starting parameter, a business logic process daemon rule and a message forwarding rule.
And the self-starting item configuration module 203 is used for configuring the self-starting item of the application program in the operating system, so that the agent process is automatically started after the operating system is started, and the operating system is restarted.
And the agent process starting module 204 is configured to automatically start the agent process, and the agent process starts the service logic process according to the agent process configuration file.
A multi-process software system building module 205, configured to enable the agent process to enter a daemon state and a message forwarding state of the business logic process, so as to build a multi-process software system.
The invention also includes: the business logic process starting/guarding module is used for starting one or more business logic processes by utilizing the agent process or guarding one or more business logic processes by utilizing the agent process; the interactive information processing module is used for processing the interactive information sent to the agent process by the service logic process by using the agent process; and the interactive information forwarding module is used for forwarding the interactive information among the service logic processes by utilizing the agent process.
The service logic process starting/guarding module specifically comprises: the business logic process structure list constructing unit is used for reading the agent process configuration file by using the agent process and constructing a business logic process structure list; the business logic process structure body list comprises a plurality of business logic process structure bodies; the business logic process structure body is internally stored with a business logic process name, a starting parameter, a business logic process daemon rule and an association table of the business logic process and an interactive information name; an interactive information channel construction unit, configured to sequentially start service logic processes in an assigned path according to the service logic process structure list, transmit start parameters corresponding to the service logic processes in the assigned path to the service logic processes, and construct an interactive information channel between the agent process and the service logic processes; and the monitoring unit is used for monitoring the running state of the business logic process in real time by utilizing the agent process based on the interactive information channel under the support of the operating system.
The invention also includes: the searching unit is used for searching a service logic process daemon rule corresponding to the exited service logic process from the service logic process structure list by using the agent process after any service logic process exits; the judging unit is used for judging whether the exited business logic process needs to be guarded or not according to the business logic process guarding rule; the starting unit is used for restarting the business logic process by utilizing the agent process when the exited business logic process needs to be guarded; and the step returning unit is used for not performing any processing by the agent process when the exited service logic process does not need to be guarded.
Under the multi-process architecture, each service logic module monopolizes one process, and compared with the multi-thread architecture, the invention has the following advantages:
the programming complexity is reduced, and the maintenance and the parallel development are easy.
Each process is independent, one module is crashed, the operation of the whole application system is not influenced, and the robustness of the system is enhanced.
Each module process can obtain more system resources and can exert greater performance.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system disclosed by the embodiment, the description is relatively simple because the system corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description.
The principles and embodiments of the present invention have been described herein using specific examples, which are provided only to help understand the method and the core concept of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In view of the above, the present disclosure should not be construed as limiting the invention.

Claims (8)

1. A method for constructing an embedded software system based on a multi-process architecture idea is characterized by comprising the following steps:
acquiring an actual service scene, and constructing one or more service logic processes according to the actual service scene; each business logic process comprises a plurality of functions; the multiple functions comprise a parameter receiving and starting function, a parameter analyzing and starting function, an interactive information channel establishing function, an interactive information sending function and an interactive information analyzing function; the business logic processes are independent from each other;
constructing a proxy process according to the actual service scene and compiling a proxy process configuration file; the agent process configuration file comprises a business logic process name, a starting parameter, a business logic process daemon rule and a message forwarding rule;
configuring an application program self-starting item in an operating system, so that the agent process is automatically started after the operating system is started, and restarting the operating system;
automatically starting the agent process, wherein the agent process starts the business logic process according to the agent process configuration file;
and the agent process enters a daemon state and a message forwarding state of the business logic process to construct a multi-process software system.
2. The method for constructing an embedded software system based on multi-process architecture idea according to claim 1, wherein the agent process is automatically started, the agent process starts the service logic process according to the agent process configuration file, and then further comprising:
starting one or more business logic processes by using the agent process, or using the agent process to defend one or more business logic processes;
processing the interactive information sent to the agent process by the service logic process by using the agent process;
and forwarding the interactive information among the plurality of business logic processes by utilizing the agent process.
3. The method for constructing an embedded software system based on multi-process architecture idea according to claim 2, wherein the starting of one or more business logic processes by using the agent process or the daemon of one or more business logic processes by using the agent process specifically comprises:
reading the agent process configuration file by using the agent process, and constructing a service logic process structure list; the business logic process structure body list comprises a plurality of business logic process structure bodies; the business logic process structure body is internally stored with a business logic process name, a starting parameter, a business logic process daemon rule and an association table of the business logic process and an interactive information name;
sequentially starting the service logic processes under the appointed path according to the service logic process structure list, transmitting the starting parameters corresponding to the service logic processes under the appointed path to the service logic processes, and constructing an interactive information channel between the agent process and the service logic processes;
and under the support of the operating system, based on the interactive information channel, utilizing the agent process to monitor the running state of the business logic process in real time.
4. The method according to claim 3, wherein the method for constructing an embedded software system based on multi-process architecture concept is characterized in that the method for monitoring the running state of the business logic process in real time by using the agent process based on the mutual information channel under the support of the operating system, and then further comprises:
after any business logic process exits, searching a business logic process daemon rule corresponding to the exited business logic process from the business logic process structure list by using the agent process;
judging whether the exited business logic process needs to be guarded or not according to the business logic process guarding rule;
if yes, restarting the business logic process by using the agent process;
if not, the proxy process does not do any processing.
5. An embedded software system construction system based on multi-process architecture idea is characterized by comprising the following steps:
the service logic process construction module is used for acquiring an actual service scene and constructing one or more service logic processes according to the actual service scene; each business logic process comprises a plurality of functions; the multiple functions comprise a parameter receiving and starting function, a parameter analyzing and starting function, an interactive information channel establishing function, an interactive information sending function and an interactive information analyzing function; the business logic processes are independent from each other;
the agent process construction and agent process configuration file compiling module is used for constructing an agent process and compiling an agent process configuration file according to the actual service scene; the agent process configuration file comprises a business logic process name, a starting parameter, a business logic process daemon rule and a message forwarding rule;
the self-starting item configuration module is used for configuring an application program self-starting item in an operating system, so that the agent process is automatically started after the operating system is started, and the operating system is restarted;
the agent process starting module is used for automatically starting the agent process, and the agent process starts the business logic process according to the agent process configuration file;
and the multi-process software system construction module is used for enabling the agent process to enter a daemon state and a message forwarding state of the business logic process so as to construct a multi-process software system.
6. The embedded software system building system based on multi-process architecture idea of claim 5, further comprising:
the business logic process starting/guarding module is used for starting one or more business logic processes by utilizing the agent process or guarding one or more business logic processes by utilizing the agent process;
the interactive information processing module is used for processing the interactive information sent to the agent process by the service logic process by using the agent process;
and the interactive information forwarding module is used for forwarding the interactive information among the service logic processes by utilizing the agent process.
7. The embedded software system building system based on multi-process architecture idea of claim 6, characterized in that the business logic process starting/daemon module specifically comprises:
the business logic process structure list constructing unit is used for reading the agent process configuration file by using the agent process and constructing a business logic process structure list; the business logic process structure body list comprises a plurality of business logic process structure bodies; the business logic process structure body is internally stored with a business logic process name, a starting parameter, a business logic process daemon rule and an association table of the business logic process and an interactive information name;
an interactive information channel construction unit, configured to sequentially start service logic processes in an assigned path according to the service logic process structure list, transmit start parameters corresponding to the service logic processes in the assigned path to the service logic processes, and construct an interactive information channel between the agent process and the service logic processes;
and the monitoring unit is used for monitoring the running state of the business logic process in real time by utilizing the agent process based on the interactive information channel under the support of the operating system.
8. The embedded software system building system based on multi-process architecture idea of claim 7, further comprising:
the searching unit is used for searching a service logic process daemon rule corresponding to the exited service logic process from the service logic process structure list by using the agent process after any service logic process exits;
the judging unit is used for judging whether the exited business logic process needs to be guarded or not according to the business logic process guarding rule;
the starting unit is used for restarting the business logic process by utilizing the agent process when the exited business logic process needs to be guarded;
and the step returning unit is used for not performing any processing by the agent process when the exited service logic process does not need to be guarded.
CN202110370919.XA 2021-04-07 2021-04-07 Embedded software system construction method and system based on multi-process architecture idea Pending CN113076131A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110370919.XA CN113076131A (en) 2021-04-07 2021-04-07 Embedded software system construction method and system based on multi-process architecture idea

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110370919.XA CN113076131A (en) 2021-04-07 2021-04-07 Embedded software system construction method and system based on multi-process architecture idea

Publications (1)

Publication Number Publication Date
CN113076131A true CN113076131A (en) 2021-07-06

Family

ID=76615247

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110370919.XA Pending CN113076131A (en) 2021-04-07 2021-04-07 Embedded software system construction method and system based on multi-process architecture idea

Country Status (1)

Country Link
CN (1) CN113076131A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101119392A (en) * 2007-08-21 2008-02-06 南京联创科技股份有限公司 SOCKET united access method
WO2011118003A1 (en) * 2010-03-25 2011-09-29 株式会社エヌ・ティ・ティ・データ・セキスイシステムズ Web application building system, web application building method, web application building program, and recording medium on which web application building is recorded
US20140032276A1 (en) * 2012-07-30 2014-01-30 International Business Machines Corporation Method And Apparatus For Assessing Layered Architecture Principles Compliance For Business Analytics In Traditional And SOA Based Environments
CN105224395A (en) * 2015-10-10 2016-01-06 上海斐讯数据通信技术有限公司 A kind of process management method and system
CN108563515A (en) * 2018-03-14 2018-09-21 中国银联股份有限公司 A kind of business process management method and system
CN109426556A (en) * 2017-08-31 2019-03-05 大唐移动通信设备有限公司 A kind of process scheduling method and device
CN109542597A (en) * 2018-10-23 2019-03-29 高新兴科技集团股份有限公司 Multi-process visualizes application method, system and computer storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101119392A (en) * 2007-08-21 2008-02-06 南京联创科技股份有限公司 SOCKET united access method
WO2011118003A1 (en) * 2010-03-25 2011-09-29 株式会社エヌ・ティ・ティ・データ・セキスイシステムズ Web application building system, web application building method, web application building program, and recording medium on which web application building is recorded
US20140032276A1 (en) * 2012-07-30 2014-01-30 International Business Machines Corporation Method And Apparatus For Assessing Layered Architecture Principles Compliance For Business Analytics In Traditional And SOA Based Environments
CN105224395A (en) * 2015-10-10 2016-01-06 上海斐讯数据通信技术有限公司 A kind of process management method and system
CN109426556A (en) * 2017-08-31 2019-03-05 大唐移动通信设备有限公司 A kind of process scheduling method and device
CN108563515A (en) * 2018-03-14 2018-09-21 中国银联股份有限公司 A kind of business process management method and system
CN109542597A (en) * 2018-10-23 2019-03-29 高新兴科技集团股份有限公司 Multi-process visualizes application method, system and computer storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张育军等: "《上海证券交易所联合研究报告2011证券信息前沿技术专集》", 机械工业出版社, pages: 167 - 171 *

Similar Documents

Publication Publication Date Title
CN109327509B (en) Low-coupling distributed streaming computing system of master/slave architecture
CN110389900B (en) Distributed database cluster testing method and device and storage medium
US10802906B2 (en) Monitoring method and apparatus of server, and storage medium
CN109976774B (en) Block link point deployment method, device, equipment and storage medium
US11256539B2 (en) Task processing method, apparatus, and system based on distributed system
CN108256118B (en) Data processing method, device, system, computing equipment and storage medium
CN112380093A (en) Operation and maintenance processing method and device and computer equipment
CN109450711B (en) Method, device and system for selecting master node in distributed system and storage medium
CN105897888B (en) Client connection method and system
CN104954411A (en) Method for sharing network resource by distributed system, terminal thereof and system thereof
CN103107921A (en) Monitoring method and system
CN111182065A (en) Message processing method and device based on MQTT protocol and computer equipment
CN112506702A (en) Data center disaster tolerance method, device, equipment and storage medium
CN115514667A (en) Access service processing method, system, device, electronic equipment and storage medium
CN111769979A (en) Cloud resource arranging method, system, terminal and storage medium
CN114880159A (en) Data processing method, device, equipment and storage medium
CN106708854B (en) Data export method and device
CN110661851A (en) Data exchange method and device
CN112613276A (en) Parallel execution method and system for streaming document analysis
CN113268254A (en) Cluster system installation method and device, electronic equipment and storage medium
CN111901395A (en) Multi-cluster switching method and device
CN113076131A (en) Embedded software system construction method and system based on multi-process architecture idea
CN112333229A (en) Method, device, equipment and storage medium for expanding kubernets nodes
CN111865978A (en) Method, device, equipment and medium for updating request identifier of micro-service
CN114697334B (en) Method and device for executing scheduling task

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