CN115543270B - Software architecture method, system and equipment based on message drive - Google Patents
Software architecture method, system and equipment based on message drive Download PDFInfo
- Publication number
- CN115543270B CN115543270B CN202211222994.2A CN202211222994A CN115543270B CN 115543270 B CN115543270 B CN 115543270B CN 202211222994 A CN202211222994 A CN 202211222994A CN 115543270 B CN115543270 B CN 115543270B
- Authority
- CN
- China
- Prior art keywords
- message
- instance
- controller
- information
- target
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/544—Buffers; Shared memory; Pipes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/54—Indexing scheme relating to G06F9/54
- G06F2209/548—Queue
Abstract
The invention provides a software architecture method, a system and equipment based on message driving, wherein the method comprises the following steps: determining each service module of the target software system, and mapping each service module into a controller respectively; generating a message based on the source controller instance, and sending the message to a message scheduling center; the message includes target controller class ID information; the message dispatching center analyzes the message to obtain target controller class ID information, and sends the target controller class ID information to a controller center; the controller center acquires a matched target controller instance according to the target controller class ID information; after receiving the message forwarded from the message scheduling center, the target controller instance triggers and executes a processing flow corresponding to the message; the invention is beneficial to reducing the coupling and the development complexity among the service modules, thereby being beneficial to improving the development efficiency of the software system.
Description
Technical Field
The present invention relates to the field of computer software technology, and in particular, to a software architecture method, system and device based on message driving.
Background
Under the assistance of cloud computing and mobile internet, enterprise digital transformation is accelerated, and the demand for software development is increasing. The digitization continuously changes real life, brings convenience to life, and simultaneously accelerates the period of data burst and software replacement, the development of the mobile internet and the Internet of things enables the software platform to become more diversified and fragmented, and software developers have to input more manpower and resources for multi-platform development in order to support diversified systems and platforms.
Currently, the concept of "Low-Code" is becoming more popular with the field of software development. The definition for "low code" is: a technique and tool for quickly developing applications with little or no need to write code and for quick configuration and deployment.
Many low code tools are currently available abroad, such as a designer-oriented prototype design tool "Figma," an enterprise office-oriented form and process design tool "Creator. Many excellent low code tools, such as the data engineer oriented data analysis tool "DataV", are also emerging in China. The main characteristics of the tools are the basic capability and engine base provided by the tools, and the low-code development capability of specific scene applications is provided according to the capability difference of different user groups.
However, existing low code tools generally lack simple and intuitive business logic planning capabilities: traditional development modes require that called modules be instantiated at the call site and then related methods be called when executing calls between functional modules. This will result in increased coupling between modules and complexity of development.
It should be noted that the information disclosed in the foregoing background section is only for enhancing understanding of the background of the present application and thus may include information that does not form the prior art that is already known to those of ordinary skill in the art.
Disclosure of Invention
Aiming at the problems in the prior art, the invention aims to provide a software architecture method, a system and equipment based on message driving, and provides a novel low-code tool which drives the cooperative work of each service module in a message forwarding mode, thereby reducing the coupling and development complexity of each service module and being beneficial to improving the development efficiency of a software system.
To achieve the above object, the present invention provides a software architecture method based on message driving, the method comprising the steps of:
s110, determining each service module of the target software system, and mapping each service module into a controller respectively;
s120, generating a message based on the source controller instance, and sending the message to a message dispatching center; the message includes target controller class ID information;
s130, the message dispatching center analyzes the message to obtain target controller class ID information, and sends the target controller class ID information to a controller center;
s140, the controller center acquires a matched target controller instance according to the target controller class ID information; and
and S150, after the target controller instance receives the message forwarded from the message dispatching center, triggering and executing a processing flow corresponding to the message.
Optionally, the controller center is provided with a first instance cache queue and a second instance cache queue, the first instance cache queue and the second instance cache queue are both used for caching the target controller instance, and the keep-alive time of the target controller instance in the first instance cache queue is longer than the keep-alive time of the target controller instance in the second instance cache queue.
Optionally, the method further comprises the steps of:
and when the target controller instance belongs to a second instance cache queue and the execution of the processing flow is completed, ending the life cycle corresponding to the target controller instance according to the keep-alive time length corresponding to the second instance cache queue.
Optionally, the method further comprises the steps of:
and when the target controller instance belongs to a first instance cache queue and the execution of the processing flow is completed, continuously keeping alive the life cycle corresponding to the target controller instance according to the keep alive time corresponding to the first instance cache queue.
Optionally, step S140 includes:
the controller center judges whether a target controller instance matched with the target controller class ID information exists in the first instance cache queue and the second instance cache queue;
if the target controller class ID information does not exist, the controller center generates a matched target controller instance according to the target controller class ID information, and the target controller instance is added into the first instance cache queue or the second instance cache queue.
Optionally, the message includes callback function pointer information and source controller instance ID information, and step S150 includes:
generating callback function main body information according to the callback function pointer information and the source controller instance class ID information;
the target controller instance determines a callback function corresponding to the message according to the callback function main body information;
and triggering and executing the callback function after the target controller instance receives the message.
Optionally, step S110 includes:
generating a tree data structure corresponding to the target software system;
extracting root nodes and leaf nodes in the tree data structure;
and determining each service module in the target software system according to the root node and the leaf node.
Optionally, the generating a tree data structure corresponding to the target software system includes:
extracting all kinds of entity information and call relation diagram information in a target software system;
and generating a tree data structure corresponding to the target software system according to the class entity information and the call relation diagram information.
The invention also provides a software architecture system based on the message drive, which is used for realizing the software architecture method based on the message drive, and comprises the following steps:
the service module determining and mapping module determines each service module of the target software system and maps each service module into a controller respectively;
the first message sending module is used for generating a message based on the source controller instance and sending the message to the message dispatching center; the message includes target controller class ID information;
the message scheduling center analyzes the message to obtain target controller class ID information and sends the target controller class ID information to the controller center;
the controller center acquires a matched target controller instance according to the target controller class ID information; and
and the instance triggering execution module is used for triggering and executing a processing flow corresponding to the message after the target controller instance receives the message forwarded from the message dispatching center.
The invention also provides a software architecture device based on the message drive, which comprises:
a processor;
a memory in which an executable program of the processor is stored;
wherein the processor is configured to perform the steps of any of the message-driven based software architecture methods described above via execution of the executable program.
The present invention also provides a computer readable storage medium storing a program which when executed by a processor implements the steps of any of the message-driven based software architecture methods described above.
Compared with the prior art, the invention has the following advantages and outstanding effects:
the method, the system and the equipment for the software architecture based on the message driving drive the cooperative work of the service modules in the form of message forwarding, realize the provision of a new low-code tool, reduce the coupling and the development complexity among the service modules, and further facilitate the improvement of the development efficiency of the software system.
Drawings
Other features, objects and advantages of the present invention will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the following drawings.
FIG. 1 is a schematic diagram of a software architecture method based on message driving according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a message according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a software architecture method based on message driving according to another embodiment of the present invention;
FIG. 4 is a schematic diagram of a software architecture method based on message driving according to another embodiment of the present invention;
FIG. 5 is a schematic diagram of a software architecture method based on message driving according to another embodiment of the present invention;
FIG. 6 is a schematic diagram of a software architecture method based on message driving according to another embodiment of the present invention;
FIG. 7 is a schematic diagram of a software architecture system based on message driver according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a software architecture system based on message driver according to another embodiment of the present invention;
fig. 9 is a schematic structural diagram of a software architecture device based on message driving according to an embodiment of the present invention.
Detailed Description
Other advantages and effects of the present application will be readily apparent to those skilled in the art from the present disclosure, by describing embodiments of the present application with specific examples. The present application may be embodied or applied in other specific forms and details, and various modifications and alterations may be made to the details of the present application from different points of view and application without departing from the spirit of the present application. It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other.
The embodiments of the present application will be described in detail below with reference to the drawings so that those skilled in the art to which the present application pertains can easily implement the same. This application may be embodied in many different forms and is not limited to the embodiments described herein.
In the description of the present application, reference to the terms "one embodiment," "some embodiments," "examples," "particular examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. Furthermore, the particular features, structures, materials, or characteristics may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the various embodiments or examples, and features of the various embodiments or examples, presented herein may be combined and combined by those skilled in the art without conflict.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the context of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
For the purpose of clarity of the description of the present application, components that are not related to the description are omitted, and the same or similar components are given the same reference numerals throughout the description.
Throughout the specification, when a device is said to be "connected" to another device, this includes not only the case of "direct connection" but also the case of "indirect connection" with other elements interposed therebetween. In addition, when a certain component is said to be "included" in a certain device, unless otherwise stated, other components are not excluded, but it means that other components may be included.
When a device is said to be "on" another device, this may be directly on the other device, but may also be accompanied by other devices therebetween. When a device is said to be "directly on" another device in contrast, there is no other device in between.
Although the terms first, second, etc. may be used herein to connote various elements in some instances, the elements should not be limited by the terms. These terms are only used to distinguish one element from another element. For example, a first interface, a second interface, etc. Furthermore, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It will be further understood that the terms "comprises," "comprising," "includes," and/or "including" specify the presence of stated features, steps, operations, elements, components, items, categories, and/or groups, but do not preclude the presence, presence or addition of one or more other features, steps, operations, elements, components, items, categories, and/or groups. The terms "or" and/or "as used herein are to be construed as inclusive, or meaning any one or any combination. Thus, "A, B or C" or "A, B and/or C" means "any of the following: a, A is as follows; b, a step of preparing a composite material; c, performing operation; a and B; a and C; b and C; A. b and C). An exception to this definition will occur only when a combination of elements, functions, steps or operations are in some way inherently mutually exclusive.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the language clearly indicates the contrary. The meaning of "comprising" in the specification is to specify the presence of stated features, regions, integers, steps, operations, elements, and/or components, but does not preclude the presence or addition of other features, regions, integers, steps, operations, elements, and/or components.
Although not differently defined, including technical and scientific terms used herein, all terms have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The term addition defined in the commonly used dictionary is interpreted as having a meaning conforming to the contents of the related art document and the current hint, so long as no definition is made, it is not interpreted as an ideal or very formulaic meaning too much.
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar structures, and thus a repetitive description thereof will be omitted.
As shown in fig. 1, an embodiment of the present invention discloses a software architecture method based on message driving, which is used for performing software architecture design on a target software system. The target software system comprises a plurality of service modules. The service module may be, for example, a bill-ordering module, a payment module, or a return module. In this embodiment, the method includes the following steps:
s110, each service module of the target software system is determined, and each service module is mapped to a controller. In specific implementation, each service module can be identified based on a class key or a code key in the target software system. Or the above-described target software system is generated by an MVC (model-view-controller) design pattern, and each service module is determined based on the MVC design pattern. Each business module may then be individually operated as a controller. The controller is responsible for a single business processing process, and different business processing modes can be triggered according to different input messages.
Each controller contains a message entry, a message exit, and an internal logic implementation: the message entry is responsible for receiving the message and running the corresponding process according to the message type. The message outlet is responsible for packaging specific messages as required, sending messages and pushing the logic processing process. That is, the message entry and the message exit are used to process the input and output of the message, respectively. And the message input by the message inlet is freely processed in the controller, and after the processing process of the message inlet is finished, the controlled message outlet sends a new message to the message dispatching center so as to push the next processing flow.
S120, a message is generated based on the source controller instance, and the message is sent to a message dispatching center. Specifically, each message contains information of an active controller class ID and a target controller class ID. The sender of the message may be determined as the source controller instance and the receiver of the message may be determined as the target controller instance. Referring to fig. 2, the above-described message includes not only the target controller class ID information but also information such as a message name, a message ID, source controller class ID information, a message body, and a callback function. After the source controller instance generates the message, it is forwarded to the message scheduling center.
S130, the message dispatching center analyzes the message to obtain the ID information of the target controller class, and sends the ID information of the target controller class to the controller center.
In particular, the message scheduling center is responsible for queuing and forwarding messages. The message dispatching center contains message queue and message dispatcher. The message queue is composed of a high priority queue and a low priority queue, and the message dispatcher can process the messages of the high priority queue and then process the messages in the low priority queue. After receiving the message, the message dispatcher analyzes the message, and notifies to acquire the designated target controller instance information according to the target controller class ID information in the message definition, and sends the message to the message inlet of the target controller instance. When the priority of the queues is the same, the message processing can be sequentially performed based on the first-in first-out, last-in last-out order.
And S140, the controller center acquires the matched target controller instance according to the target controller class ID information. Specifically, the message scheduling center acquires the target controller instance from the controller center according to the target controller class ID specified in the message body. When receiving the ID of the target controller class, the controller center searches the buffer queue for whether there is a corresponding controller instance. If not found, a new controller instance is instantiated and then placed in the cache queue.
And S150, after the target controller instance receives the message forwarded from the message dispatching center, triggering and executing a processing flow corresponding to the message. That is, after the target controller instance acquires successfully, the message scheduling center sends a message to the message entry of the target controller instance, triggering the target controller instance to execute a specific processing flow bound with the current message.
On the other hand, for the existing low-code tools, when the traditional development mode executes the call between the functional modules, the developer needs to manage the life cycle of the called module, and know the specific method parameters and return types of the called module, which also leads to the increase of the development complexity.
To solve the above problem, in another embodiment of the present application, another message-driven based software architecture method is disclosed. In this embodiment, the controller center is formed by a first instance cache queue, a second instance cache queue, and a controller class list. The controller center is responsible for instantiating and caching the controller instances, and meanwhile, class information of all controllers is contained inside, and the instantiation of the controllers is carried out when needed. The first instance cache queue and the second instance cache queue are both used for caching the target controller instance, and the keep-alive time of the target controller instance in the first instance cache queue is longer than that of the target controller instance in the second instance cache queue. The controller class list contains class definitions for all controllers.
Illustratively, for example, the first instance cache queue is a strongly referenced cache queue, and the second instance cache queue is a weakly referenced cache queue.
The first instance cache queue and the second instance cache queue are also used to assist in managing the lifecycle of the controller instance. The instance of the controller is returned when needed according to the controller class ID. For a strongly referenced controller instance queue, the life of its internal controller instance will be preserved regardless of whether the controller instance continues to be used by the outside world. Once the controller instance in the weakly referenced controller instance queue is no longer in use externally, its internal controller instance is not maintained, i.e., its lifecycle is ended.
As shown in fig. 3, in this embodiment, on the basis of the corresponding embodiment of fig. 1, the method further includes the steps of:
s160, when the target controller instance belongs to a second instance cache queue and the execution of the processing flow is completed, ending the life cycle corresponding to the target controller instance according to the keep-alive time length corresponding to the second instance cache queue. That is, for a weakly referenced controller instance queue, once the controller instance is no longer used externally, it will not hold its internal controller instance, i.e., end its lifecycle.
In this embodiment, each service module automatically performs memory management under the drive of the message, so that the lifecycle of the called module of the developer is not required, and development efficiency is improved.
As shown in fig. 4, in some embodiments, on the basis of the corresponding embodiment of fig. 3, the method further includes the steps of:
s170, when the target controller instance belongs to the first instance cache queue and the execution of the processing flow is completed, the life cycle corresponding to the target controller instance is continuously kept alive according to the keep-alive time length corresponding to the first instance cache queue. That is, for a strongly referenced controller instance queue, the life of its internal controller instance will be preserved regardless of whether the controller instance continues to be used by the outside world.
In this embodiment, each service module automatically performs memory management under the drive of the message, so that the lifecycle of the called module of the developer is not required, and development efficiency is improved.
In some embodiments, step S140 includes, based on the corresponding embodiment of fig. 3, steps of:
and the controller center judges whether a target controller instance matched with the target controller class ID information exists in the first instance cache queue and the second instance cache queue.
If the target controller class ID information does not exist, the controller center generates a matched target controller instance according to the target controller class ID information, and the target controller instance is added into the first instance cache queue or the second instance cache queue.
If so, directly searching.
That is, after receiving the ID information of the target controller class, the controller center will first find whether there is a corresponding controller instance in the cache queue. If not found, a new controller instance is instantiated and then placed in the cache queue.
As shown in fig. 5, in another embodiment of the present application, based on the corresponding embodiment of fig. 1, step S110 includes:
s113, generating a tree data structure corresponding to the target software system.
S114, extracting root nodes and leaf nodes in the tree data structure.
S115, determining each service module in the target software system according to the root node and the leaf node, and mapping each service module into a controller.
After the tree data structure is generated, the service modules are determined based on the root node and the leaf node, so that the accuracy of extracting each service module in the target software system is improved, and the accuracy of calling relations of each controller instance is improved; thereby facilitating an increase in accuracy of message scheduling.
In some embodiments, on the basis of steps S114 and S115 including the corresponding embodiment of fig. 5, the method further includes the steps of:
s111, extracting all kinds of entity information and call relation diagram information in the target software system.
S112, generating a tree data structure corresponding to the target software system according to the class entity information and the call relation diagram information.
As shown in fig. 6, in some embodiments, the message includes callback function pointer information and source controller class ID information based on the corresponding embodiment of fig. 1. Step S150 includes:
and S151, generating callback function main body information according to the callback function pointer information and the source controller instance class ID information.
S152, the target controller instance determines a callback function corresponding to the message according to the callback function main body information.
And S153, after the target controller instance receives the message, triggering and executing the callback function.
According to the technical scheme provided by the invention, the business logic of any software can be completed by the controller, the message scheduling center, the controller center and the message. The controller is instantiated according to the need through the message forwarding, the specific business processing process is completed, and the whole software operation is pushed by the message forwarding, so that a message-driven software architecture system is realized.
It should be noted that, all the embodiments disclosed in the present application may be freely combined, and the technical solution obtained after combination is also within the protection scope of the present application.
As shown in fig. 7, an embodiment of the present invention further discloses a software architecture system based on message driving, which includes a source controller instance 71, a message scheduling center 72, a controller center 73, and a target controller instance 74.
The source controller instance 71 is configured to generate a message and send the message to a message dispatch center. The message includes target controller class ID information.
The message scheduling center 72 is configured to parse the message to obtain target controller ID information, and send the target controller ID information to the controller center 73; and forwards the message to the target controller instance 74.
The controller center 73 is configured to obtain a matched target controller instance 74 according to the target controller class ID information.
The target controller instance 74 is configured to trigger execution of a process flow corresponding to the message after receiving the message forwarded from the message scheduling center.
The source controller instance and the target controller instance are responsible for a single service processing process, and different service processing modes can be triggered according to different input messages. The message dispatching center is responsible for priority control of the message and forwarding of the message. The controller hub is responsible for instantiating the controller objects as needed and caching the controller instances.
As shown in fig. 8, an embodiment of the present invention further discloses a software architecture system 8 based on message driving, which includes:
the service module determining and mapping module 81 determines each service module of the target software system and maps each service module to a controller.
The first message sending module 82 generates a message based on the source controller instance and sends the message to the message scheduling center. The message includes target controller class ID information.
The target controller ID obtaining module 83, the message scheduling center analyzes the message to obtain target controller ID information, and sends the target controller ID information to the controller center.
The target controller instance obtaining module 84, where the controller center obtains the matched target controller instance according to the target controller class ID information. and
And an instance triggering and executing module 85, wherein the target controller instance triggers and executes the processing flow corresponding to the message after receiving the message forwarded from the message dispatching center.
It will be appreciated that the message-driven software architecture system of the present invention also includes other existing functional modules that support the operation of the message-driven software architecture system. The message-driven based software architecture system shown in fig. 8 is only an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
The message-driven software architecture system in this embodiment is used to implement the method of the message-driven software architecture, so for the specific implementation steps of the message-driven software architecture system, reference may be made to the description of the method of the message-driven software architecture, which is not repeated here.
The embodiment of the invention also discloses a software architecture device based on message driving, which comprises a processor and a memory, wherein the memory stores an executable program of the processor; the processor is configured to perform the steps in the message-driven based software architecture method described above via execution of an executable program. Fig. 9 is a schematic structural diagram of a message-driven-based software architecture device according to the present disclosure. An electronic device 600 according to this embodiment of the invention is described below with reference to fig. 9. The electronic device 600 shown in fig. 9 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 9, the electronic device 600 is in the form of a general purpose computing device. Components of electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one memory unit 620, a bus 630 connecting the different platform components (including memory unit 620 and processing unit 610), a display unit 640, etc.
Wherein the storage unit stores program code that is executable by the processing unit 610 such that the processing unit 610 performs the steps according to various exemplary embodiments of the present invention described in the message-driven based software architecture methods section of the present specification. For example, the processing unit 610 may perform the steps as shown in fig. 1.
The storage unit 620 may include readable media in the form of volatile storage units, such as Random Access Memory (RAM) 6201 and/or cache memory unit 6202, and may further include Read Only Memory (ROM) 6203.
The storage unit 620 may also include a program/utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 600, and/or any device (e.g., router, modem, etc.) that enables the electronic device 600 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 650. Also, electronic device 600 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 over the bus 630. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 600, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage platforms, and the like.
The invention also discloses a computer readable storage medium for storing a program which when executed implements the steps in the message-driven software architecture method. In some possible embodiments, the aspects of the invention may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps according to the various exemplary embodiments of the invention as described in the above-mentioned message-driven software architecture method of this specification, when the program product is run on the terminal device.
As described above, when the program of the computer readable storage medium of the embodiment is executed, the cooperative work of each service module is driven by the form of message forwarding, so that a new low-code tool is provided, the coupling and the development complexity between each service module are reduced, and the development efficiency of a software system is improved; on the other hand, each service module automatically performs memory management under the drive of the message, so that the life cycle of the called module of the developer is not needed, and the development efficiency is improved.
An embodiment of the invention discloses a computer readable storage medium. The storage medium is a program product implementing the above method, which may employ a portable compact disc read only memory (CD-ROM) and comprise program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a 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 program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, 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 readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, with readable program code embodied therein. 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 readable storage medium may also be any readable medium 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 readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
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, C++ or the like 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 computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The method, the system and the equipment for constructing the software based on the message drive the cooperative work of each service module in the form of message forwarding, realize providing a new low-code tool, reduce the coupling and the development complexity among each service module, and thereby be beneficial to improving the development efficiency of a software system; on the other hand, each service module automatically performs memory management under the drive of the message, so that the life cycle of the called module of the developer is not needed, and the development efficiency is improved.
The foregoing is a further detailed description of the invention in connection with the preferred embodiments, and it is not intended that the invention be limited to the specific embodiments described. It will be apparent to those skilled in the art that several simple deductions or substitutions may be made without departing from the spirit of the invention, and these should be considered to be within the scope of the invention.
Claims (8)
1. A message-driven based software architecture method, comprising the steps of:
s110, determining each service module of the target software system, and mapping each service module into a controller respectively;
s120, generating a message based on the source controller instance, and sending the message to a message dispatching center; the message includes target controller class ID information;
s130, the message dispatching center analyzes the message to obtain target controller class ID information, and sends the target controller class ID information to a controller center;
s140, the controller center acquires a matched target controller instance according to the target controller class ID information; and
s150, after the target controller instance receives the message forwarded from the message dispatching center, triggering and executing a processing flow corresponding to the message;
the controller center is provided with a first instance cache queue and a second instance cache queue, the first instance cache queue and the second instance cache queue are both used for caching the target controller instance, and the keep-alive time of the target controller instance in the first instance cache queue is longer than that of the target controller instance in the second instance cache queue;
the message includes callback function pointer information and source controller instance class ID information, and step S150 includes:
generating callback function main body information according to the callback function pointer information and the source controller instance class ID information;
the target controller instance determines a callback function corresponding to the message according to the callback function main body information;
and triggering and executing the callback function after the target controller instance receives the message.
2. The software architecture method of claim 1, wherein the method further comprises the steps of:
and when the target controller instance belongs to a second instance cache queue and the execution of the processing flow is completed, ending the life cycle corresponding to the target controller instance according to the keep-alive time length corresponding to the second instance cache queue.
3. The software architecture method of claim 1, wherein the method further comprises the steps of:
and when the target controller instance belongs to a first instance cache queue and the execution of the processing flow is completed, continuously keeping alive the life cycle corresponding to the target controller instance according to the keep alive time corresponding to the first instance cache queue.
4. The software architecture method of claim 1, wherein step S140 includes:
the controller center judges whether a target controller instance matched with the target controller class ID information exists in the first instance cache queue and the second instance cache queue;
if the target controller class ID information does not exist, the controller center generates a matched target controller instance according to the target controller class ID information, and the target controller instance is added into the first instance cache queue or the second instance cache queue.
5. The software architecture method of claim 1, wherein step S110 includes:
generating a tree data structure corresponding to the target software system;
extracting root nodes and leaf nodes in the tree data structure;
and determining each service module in the target software system according to the root node and the leaf node.
6. The software architecture method of claim 5, wherein the generating a tree data structure corresponding to the target software system comprises:
extracting all kinds of entity information and call relation diagram information in a target software system;
and generating a tree data structure corresponding to the target software system according to the class entity information and the call relation diagram information.
7. A message-driven based software architecture system for implementing the message-driven based software architecture method of claim 1, the system comprising:
the service module determining and mapping module determines each service module of the target software system and maps each service module into a controller respectively;
the first message sending module is used for generating a message based on the source controller instance and sending the message to the message dispatching center; the message includes target controller class ID information;
the message scheduling center analyzes the message to obtain target controller class ID information and sends the target controller class ID information to the controller center;
the controller center acquires a matched target controller instance according to the target controller class ID information; and
and the instance triggering execution module is used for triggering and executing a processing flow corresponding to the message after the target controller instance receives the message forwarded from the message dispatching center.
8. A message-driven based software architecture device, comprising:
a processor;
a memory in which an executable program of the processor is stored;
wherein the processor is configured to perform the steps of the message driven based software architecture method of any one of claims 1 to 6 via execution of the executable program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211222994.2A CN115543270B (en) | 2022-10-08 | 2022-10-08 | Software architecture method, system and equipment based on message drive |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211222994.2A CN115543270B (en) | 2022-10-08 | 2022-10-08 | Software architecture method, system and equipment based on message drive |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115543270A CN115543270A (en) | 2022-12-30 |
CN115543270B true CN115543270B (en) | 2023-06-16 |
Family
ID=84731147
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211222994.2A Active CN115543270B (en) | 2022-10-08 | 2022-10-08 | Software architecture method, system and equipment based on message drive |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115543270B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117331722B (en) * | 2023-12-01 | 2024-03-15 | 中航信移动科技有限公司 | Multi-input event information processing system |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1536818A (en) * | 2003-04-10 | 2004-10-13 | 华为技术有限公司 | Method for implementing service logic operation environment |
CN101068243A (en) * | 2007-04-12 | 2007-11-07 | 北京邮电大学 | Interactive system for processing gateway level and service layer information and transmitting and receiving method |
US9530002B1 (en) * | 2015-08-26 | 2016-12-27 | Christopher Luis Hamlin | Verifying the integrity of a computing platform |
CN109144750A (en) * | 2018-08-21 | 2019-01-04 | 武汉斗鱼网络科技有限公司 | A kind of message treatment method, device, electronic equipment and storage medium |
CN109491804A (en) * | 2018-10-11 | 2019-03-19 | 视联动力信息技术股份有限公司 | Method for message transmission and device |
US10361985B1 (en) * | 2016-09-22 | 2019-07-23 | Amazon Technologies, Inc. | Message processing using messaging services |
CN110309002A (en) * | 2019-05-29 | 2019-10-08 | 北京达佳互联信息技术有限公司 | Message treatment method, device, electronic equipment and storage medium |
CN114741335A (en) * | 2022-04-20 | 2022-07-12 | 腾讯科技(深圳)有限公司 | Cache management method, device, medium and equipment |
CN114979260A (en) * | 2022-05-12 | 2022-08-30 | 深圳市绿联科技股份有限公司 | Protocol-based communication method and device, electronic equipment and storage medium |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060101467A1 (en) * | 2004-10-18 | 2006-05-11 | International Business Machines Corporation | Process execution management based on resource requirements and business impacts |
US20100325640A1 (en) * | 2009-06-17 | 2010-12-23 | International Business Machines Corporation | Queueing messages related by affinity set |
US8510751B2 (en) * | 2010-03-18 | 2013-08-13 | International Business Machines Corporation | Optimizing workflow engines |
CN111831402A (en) * | 2019-04-15 | 2020-10-27 | 戴尔产品有限公司 | Method, apparatus and computer program product for managing software functions |
-
2022
- 2022-10-08 CN CN202211222994.2A patent/CN115543270B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1536818A (en) * | 2003-04-10 | 2004-10-13 | 华为技术有限公司 | Method for implementing service logic operation environment |
CN101068243A (en) * | 2007-04-12 | 2007-11-07 | 北京邮电大学 | Interactive system for processing gateway level and service layer information and transmitting and receiving method |
US9530002B1 (en) * | 2015-08-26 | 2016-12-27 | Christopher Luis Hamlin | Verifying the integrity of a computing platform |
US10361985B1 (en) * | 2016-09-22 | 2019-07-23 | Amazon Technologies, Inc. | Message processing using messaging services |
CN109144750A (en) * | 2018-08-21 | 2019-01-04 | 武汉斗鱼网络科技有限公司 | A kind of message treatment method, device, electronic equipment and storage medium |
CN109491804A (en) * | 2018-10-11 | 2019-03-19 | 视联动力信息技术股份有限公司 | Method for message transmission and device |
CN110309002A (en) * | 2019-05-29 | 2019-10-08 | 北京达佳互联信息技术有限公司 | Message treatment method, device, electronic equipment and storage medium |
CN114741335A (en) * | 2022-04-20 | 2022-07-12 | 腾讯科技(深圳)有限公司 | Cache management method, device, medium and equipment |
CN114979260A (en) * | 2022-05-12 | 2022-08-30 | 深圳市绿联科技股份有限公司 | Protocol-based communication method and device, electronic equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
面向消息驱动框架的实体管理模块设计与实现;王永近;李廉;;江西师范大学学报(自然科学版)(第03期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN115543270A (en) | 2022-12-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7865887B2 (en) | Context based event handling and execution with prioritization and interrupt management | |
US7475107B2 (en) | System and method for managing distributed computer processes | |
JP5936157B2 (en) | Systems, methods, and computer programs for hidden automated data mirroring for native interfaces in distributed virtual machines (hidden automated data mirroring for native interfaces in distributed virtual machines ) | |
US20140136717A1 (en) | Configuring cloud resources | |
WO2020042385A1 (en) | Robot cluster scheduling system | |
US8874638B2 (en) | Interactive analytics processing | |
CN1625179B (en) | Send by reference in a customizable, tag-based protocol | |
US20200285508A1 (en) | Method and Apparatus for Assigning Computing Task | |
CN102902763B (en) | The method of association, retrieving information process data and process information task and device | |
CN113934464A (en) | Method and device for starting android application in Linux system and electronic equipment | |
CN115543270B (en) | Software architecture method, system and equipment based on message drive | |
US11321090B2 (en) | Serializing and/or deserializing programs with serializable state | |
CN109669787B (en) | Data transmission method and device, storage medium and electronic equipment | |
CN113971037A (en) | Application processing method and device, electronic equipment and storage medium | |
CN110377401B (en) | Transaction request processing method, device, server and storage medium based on IDEA | |
CN113986569A (en) | Message processing method and device and electronic equipment | |
CN110231983B (en) | Data concurrent processing method, device and system, computer equipment and readable medium | |
CN113673872A (en) | Replenishment processing method and device, storage medium and electronic equipment | |
CN110647405A (en) | System message processing method, electronic device, and computer-readable storage medium | |
CN115563183B (en) | Query method, query device and program product | |
US8560544B2 (en) | Clustering of analytic functions | |
EP4109263A1 (en) | Low latency remoting to accelerators | |
CN111367875B (en) | Ticket file processing method, system, equipment and medium | |
CN113141407B (en) | Page resource loading method and device and electronic equipment | |
CN111782426B (en) | Method and device for processing client tasks and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |