CN113515325A - Software system extension plug-in application method of command word communication mode - Google Patents
Software system extension plug-in application method of command word communication mode Download PDFInfo
- Publication number
- CN113515325A CN113515325A CN202110878668.6A CN202110878668A CN113515325A CN 113515325 A CN113515325 A CN 113515325A CN 202110878668 A CN202110878668 A CN 202110878668A CN 113515325 A CN113515325 A CN 113515325A
- Authority
- CN
- China
- Prior art keywords
- command word
- request
- plug
- extension plug
- exists
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 25
- 238000004891 communication Methods 0.000 title claims abstract description 24
- 238000013507 mapping Methods 0.000 claims abstract description 6
- 238000012545 processing Methods 0.000 claims abstract description 6
- 230000000977 initiatory effect Effects 0.000 claims abstract description 4
- 238000002347 injection Methods 0.000 claims description 4
- 239000007924 injection Substances 0.000 claims description 4
- 230000006870 function Effects 0.000 description 31
- 238000012795 verification Methods 0.000 description 7
- 238000013461 design Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005538 encapsulation Methods 0.000 description 1
- 239000000243 solution Substances 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
-
- 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/547—Remote procedure calls [RPC]; Web services
Abstract
The invention belongs to the technical field of software, and discloses a software system extension plug-in application method of a command word communication mode, which comprises the steps of adding a command word into a corresponding software system, and adding a callback function corresponding to the command word; initiating a command word request and designating an extension plug-in through a command word instruction, forwarding the corresponding command word request to the designated extension plug-in by the system, and judging whether the command word exists and whether the command word request meets the requirement after the extension plug-in receives the command word request; and when the command word exists and meets the requirement, the command word mapping function is called back by the extension plug-in to process the request parameter and output a processing result. The extended plug-in command word can support a multi-system multi-plug-in mode and can realize distributed calling among systems in a microservice mode.
Description
Technical Field
The invention relates to the technical field of software, in particular to a method for applying a software system extension plug-in a command word communication mode.
Background
At present, in the industry, a database is generally adopted as a communication and coordination mode among multiple plug-ins, and each extension plug-in operates the database (such as an application program in the Taobao service market) through an API (application program interface), or directly operates the database (such as a plug-in a Discuz X application center), so that communication, configuration, cooperation, calling and other operations of other extension plug-ins are realized by taking the database as a relay. However, if the other plug-in is a plug-in with pure function and no data storage, or a plug-in without data interaction, the communication, configuration, cooperation, calling, etc. operations between the plug-ins will fail. Moreover, the database is used as a plug-in mechanism of the transfer, and the data structure is required to be a very standardized plan, so that all plug-in developers can be familiar with and know the purposes of all links in the data structure.
According to the plug-in mechanism scheme which is commonly adopted, due to the fact that standardization of a data structure is very depended on, once the data structure changes, all plug-ins need to be modified in a linkage mode, and the plug-ins can only be communicated through a database, direct communication between the plug-ins cannot be achieved, and distributed communication and calling cannot be achieved.
Disclosure of Invention
The invention aims to provide a software system extension plug-in application method of a command word communication mode, which can realize distributed calling between systems in a microservice mode.
In order to achieve the above object, the present invention provides a method for applying a software system extension plug-in a command word communication mode, comprising the steps of:
adding a command word into a corresponding software system, and adding a callback function corresponding to the command word;
initiating a command word request through a command word instruction, and forwarding the corresponding command word request to a corresponding extension plug-in;
after the extended plug-in receives the command word request, judging whether the command word exists and judging whether the command word request meets the requirement;
and when the command word exists and meets the requirement, processing the command word request through the extended plug-in callback command word mapping function and outputting a request result.
The command word request information comprises a command word, a request plug-in, request parameters and an output format requirement, wherein the request parameters are one or more.
Before forwarding the corresponding command word request to the corresponding extension plug-in, the method further includes:
and judging whether the extension plug-in exists or not, if so, forwarding the corresponding command word request to the corresponding extension plug-in, and if not, returning prompt information.
After receiving the command word request, the extension plug-in determines whether the command word exists and whether the command word request meets the requirements, including:
when the extension plug-in receives the command word request, checking whether the command word exists in the software system;
if the command word exists, executing the command word request, and judging whether the command word request meets the requirement or not;
and if the command word does not exist, returning prompt information.
If the command word exists, executing the command word request, and judging whether the command word request meets the requirement, wherein the step of:
and after receiving the command word request, the extended plug-in unit respectively verifies whether the command word request meets the requirements of correctness and legality, wherein the correctness is to verify whether parameters in the command word request are matched with the format of the extended plug-in unit, and the legality is to verify whether the parameters in the command word request contain dangerous intrusion and injection code contents.
Wherein the method further comprises:
and if the parameters in the command word request do not meet the requirements, returning prompt information.
The method for applying the command word communication mode software system extension plug-in can effectively solve the problem of plug-in mechanism generally adopted in the industry at present. From the perspective of system design and service encapsulation, a 'command word' design mode is invented, namely, one plug-in module comprises a plurality of functions, the calling mode of the functions is called as 'command words', and the plug-in functions are called externally through the command word mode. For developers, the form is concise and easy to develop; for system communication, the plug-in communication mode is simple and can be called through a direct request mode. According to the software design idea, from the subsequent framework expansion, a single framework can support multiple plugins, can support a multi-system multi-plugin mode, and can realize distributed calling among systems in a microservice mode.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic diagram illustrating steps of a method for applying a software system extension plug-in a command word communication mode according to the present invention.
Fig. 2 is a schematic flow chart of a method for applying a software system extension plug-in a command word communication mode according to the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
Further, in the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
Referring to fig. 1 and 2, the present invention provides a method for applying a software system extension plug-in a command word communication mode, comprising the following steps:
each function or each group of functions in the software system can be packaged into a command word, and a complete command word communication flow comprises a request input and a result output. The plug-in packages the own function into a command word, in the system or the calling communication of the cross system, the command word of the direct cmd plug-in can directly communicate and call the plug-in function in a cmd instruction mode, and the result data returned by the plug-in can be appointed to be in any format. The method can be applied to software systems in a self-hosting mode, a SaaS mode and a distributed mode.
S101, adding the command word into a corresponding software system, and adding a callback function corresponding to the command word.
Specifically, 1, adding a command word in a configuration file, such as a plg _ cmd _ default command word;
2. adding a command word callback function (function name custom name) in a configuration file for mapping functions of the command word, wherein one command word can map a plurality of functions, such as plg _ cmd _ default ═ a 'and plg _ cmd _ default ═ B';
3. function functions, each function representing a function point, are specific function execution codes, such as a and B functions, a function a adds 1 to the value of the C field of the database user table, a function B subtracts 1 from the value of the D field of the database user table, and when the plg _ cmd _ default command word is requested, the functions a and B are executed together, adding and subtracting the values of the two fields.
S102, initiating a command word request through a command word instruction, and forwarding the corresponding command word request to the corresponding extension plug-in.
Specifically, whether an extension plug-in exists or not is checked, if yes, the command word request is sent to the corresponding extension plug-in, and if not, prompt information is returned; other functions or other extension plug-ins in the software system initiate a request to the system through a call instruction, and the system can forward the command word to the corresponding plug-in according to the request; the request information includes command words, request plug-ins, request parameter(s), output format requirements, and may be applied to examples of the PHP programming language, but is not limited to the PHP programming language.
S103, after the command word request is received by the extension plug-in, judging whether the command word exists and judging whether the command word request meets the requirement.
Specifically, after receiving the command request, the system checks whether the command word exists in the system (the command word defined to the system in the command word development logic is checked whether the command word exists through a configuration file), if not, the system returns a prompt message, and if so, the system executes the corresponding command word request.
The extension plug-in receives a command word request distributed by the system, and firstly verifies whether the parameters of the request are correct and safe. The correctness is to verify whether the parameters are matched with the affiliated format, for example, whether the mailbox parameters are in a correct mailbox format, whether the mobile phone number parameters are in a correct number digit, whether the integer parameters are integers, whether the website parameters are websites, and the like; the legality is to verify whether the parameters contain dangerous intrusion and code content of injection, such as SQL injection code; and when the parameters are checked to have problems, returning prompt information, and if the parameters are not checked to have problems, executing the command word callback function.
The parameter verification standards of the command words are different due to different service scenes and service purposes, so the verification logic of parameter correctness and legality is defined by a developer, and the parameter rules of verification can be flexibly defined according to a technical framework and service logic; for example, a PHP Laravel framework is used as a command word bottom layer technical framework, parameter verification can follow Laravel form verification standards, and a Lavavel technical scheme can be directly adopted in the verification method and the verification process.
And S104, when the command word exists and meets the requirement, processing the command word request through the extended plug-in callback command word mapping function and outputting a request result.
Specifically, the extension plug-in analyzes the request parameter, calls back the mapping function of the extension plug-in, and executes a specific function. After the plug-in is expanded to process the result, the result is output no matter whether the result is finished or stopped; outputting the format of the output result according to the requirement during the request, and outputting a default format if the request is not required or the required format plug-in does not support; the output information comprises a state code, a state description and result data.
In the whole using process of the command word, the plug-in function is called directly through one command word without knowing what processing logic the other side is and analyzing the command through a database between the plug-in and the plug-in.
Advantageous effects
1. The network communication programming model is realized through the command words, the complexity of processing network data is reduced, the flexibility of a main program and a plug-in mechanism is improved, and the interaction between cross-business and cross-plug-ins is more convenient.
2. The single frame can support multiple plugins, simultaneously can subsequently support a multi-system multi-plugin mode, and can realize distributed calling among systems in a microservice mode.
3. The command words are flexible in communication and convenient to upgrade, when the service of the main program of the software or a database changes, plug-in linkage upgrade is not needed, and the software can be used compatibly even when running across programming languages or SaaS.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (6)
1. A method for applying a software system extension plug-in of a command word communication mode is characterized by comprising the following steps:
adding a command word into a corresponding software system, and adding a callback function corresponding to the command word;
initiating a command word request through a command word instruction, and forwarding the corresponding command word request to a corresponding extension plug-in;
after the extended plug-in receives the command word request, judging whether the command word exists and judging whether the command word request meets the requirement;
and when the command word exists and meets the requirement, processing the command word request through the extended plug-in callback command word mapping function and outputting a request result.
2. The method for application of a software system extension plug-in of a command word communication mode according to claim 1,
the command word request information comprises a command word, a request plug-in, request parameters and output format requirements, wherein the request parameters are one or more.
3. The method of claim 1, wherein before forwarding the corresponding command word request to the corresponding extension plug-in, the method further comprises:
and judging whether the extension plug-in exists or not, if so, forwarding the corresponding command word request to the corresponding extension plug-in, and if not, returning prompt information.
4. The method as claimed in claim 1, wherein the step of determining whether the command word exists and whether the command word request meets the requirement after the command word request is received by the extension plug-in comprises:
when the extension plug-in receives the command word request, checking whether the command word exists in the software system;
if the command word exists, executing the command word request, and judging whether the command word request meets the requirement or not;
and if the command word does not exist, returning prompt information.
5. The method as claimed in claim 4, wherein if the command word exists, executing the command word request and determining whether the command word request meets the requirement comprises:
and after receiving the command word request, the extended plug-in unit respectively verifies whether the command word request meets the requirements of correctness and legality, wherein the correctness is to verify whether parameters in the command word request are matched with the format of the extended plug-in unit, and the legality is to verify whether the parameters in the command word request contain dangerous intrusion and injection code contents.
6. The method for software system extension plug-in application of command word communication mode according to claim 4, further comprising:
and if the parameters in the command word request do not meet the requirements, returning prompt information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110878668.6A CN113515325A (en) | 2021-08-02 | 2021-08-02 | Software system extension plug-in application method of command word communication mode |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110878668.6A CN113515325A (en) | 2021-08-02 | 2021-08-02 | Software system extension plug-in application method of command word communication mode |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113515325A true CN113515325A (en) | 2021-10-19 |
Family
ID=78068025
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110878668.6A Pending CN113515325A (en) | 2021-08-02 | 2021-08-02 | Software system extension plug-in application method of command word communication mode |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113515325A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116627547A (en) * | 2023-05-18 | 2023-08-22 | 弗雷森斯(苏州)科技有限公司 | Extension method and system of software system based on command word frame |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102682014A (en) * | 2011-03-14 | 2012-09-19 | 腾讯科技(深圳)有限公司 | Open-type plug-in module management platform implemented on browser and open-type plug-in module management method |
-
2021
- 2021-08-02 CN CN202110878668.6A patent/CN113515325A/en active Pending
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102682014A (en) * | 2011-03-14 | 2012-09-19 | 腾讯科技(深圳)有限公司 | Open-type plug-in module management platform implemented on browser and open-type plug-in module management method |
Non-Patent Citations (1)
Title |
---|
唐杰: ""Fresns 命令字扩展插件机制介绍"", 《HTTPS://TANGJIE.ME/BLOG/150.HTML》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116627547A (en) * | 2023-05-18 | 2023-08-22 | 弗雷森斯(苏州)科技有限公司 | Extension method and system of software system based on command word frame |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JPH06195290A (en) | Method and system for access of processing procedure from remote node | |
CN110351325B (en) | Data processing method and related equipment | |
CN108804100B (en) | Method and device for creating interface element, storage medium and mobile terminal | |
CN110958024A (en) | Serial port data encoding method and device, embedded device and communication system | |
CN107577629B (en) | Data interface processing method, device, server and medium | |
CN113515325A (en) | Software system extension plug-in application method of command word communication mode | |
CN110674205B (en) | Single table query method, device, terminal and readable storage medium | |
US20220245080A1 (en) | Method for communication of a componentized application, computing device and computer storage medium | |
CN111506368A (en) | Method, device, equipment and storage medium for transferring asynchronous call to synchronous call | |
CN109343970B (en) | Application program-based operation method and device, electronic equipment and computer medium | |
CN112395339A (en) | Method and device for checking data access between systems, computer equipment and storage medium | |
CN112860462A (en) | Method, device and system for realizing interconnection and intercommunication of IOT platform bases | |
CN108681491B (en) | File decoupling method and system | |
CN109377348A (en) | Applied to the business interface call method for helping loan operation system and help loan operation system | |
CN115934093A (en) | Applet cross-terminal application method, related device and computer storage medium | |
CN115291933A (en) | Method, device and equipment for constructing small program data packet and storage medium | |
CN112711602B (en) | Method and device for running stored procedure, database system and storage medium | |
CN109426720B (en) | Interface parameter verification method and related device | |
CN102739882B (en) | Seating system, seating system client and processing method of seating system client | |
WO2021232909A1 (en) | Remote function customization method and apparatus, device, and storage medium | |
CN117555645B (en) | Data processing method, device, equipment and medium based on multi-terminal application platform | |
CN109814916A (en) | A kind of configuration method, device, storage medium and the server of IVR process | |
CN116360752B (en) | Function programming method oriented to java, intelligent terminal and storage medium | |
CN114978786B (en) | Method and device for converting third party interface into system standard interface | |
CN114116067A (en) | Information configuration method and device for internal and external systems, electronic equipment and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 215400 room 801, building 11, University Science Park, 20 Jianxiong Road, science and education new town, Taicang City, Suzhou City, Jiangsu Province Applicant after: Fresens (Suzhou) Technology Co.,Ltd. Address before: 215400 room 801, building 11, University Science Park, 20 Jianxiong Road, science and education new town, Taicang City, Suzhou City, Jiangsu Province Applicant before: Taicang zhiranxin Network Technology Co.,Ltd. |
|
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20211019 |