A programming system and method for assembling and integrating based on decompilation features
Through the assembly and integration system based on decompilation features, the problems of too many branches and difficult maintenance during the programming process are solved, achieving a short development cycle, low operating costs and high reusability, and is suitable for multiple scenarios and industry environments.
Patent Information
- Application Number
- CN202310034227.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-10
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2043-01-10
AI Technical Summary
The existing programming process has too many branches, difficult product maintenance, high work complexity, and difficulty in code management and handover, resulting in long development cycles, mixed business logic, and high later operation and maintenance costs.
Adopting an assembly integration system based on decompilation features, through plug-in warehousing module and assembly integration module, including process startup unit, service inspection unit, file detection unit, method addressing unit and software hot loading unit, the assembly and integration of program design requirements are realized , using decompilation technology to create thread initialization modules to reduce code redundancy and complexity.
It achieves a short development cycle, clear business logic, low post-operation and maintenance costs, and high code reusability, and is suitable for multiple scenarios and industry environments.
Smart Images

Figure CN116048605B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer software design, and in particular relates to a program design system and method for assembling and integrating based on decompilation features. Background Art
[0002] With the continuous development of my country's high-tech industry and the deepening and popularization of the Internet era, the production and demand of programs are becoming more and more complex. The needs of different companies are different, and customized programs have become the focus of enterprises. Although the overall needs are similar, different companies will require the program to provide corresponding functions according to their own business needs.
[0003] In order to meet the business needs of different scenarios, software production often adopts the method of establishing branches in the program, or rebuilding the framework and writing applications. However, new problems arise. Too many branches will make software management and maintenance large and complicated. The functional transformation of different products is spent on a lot of repetitive work. Moreover, the code writing of different branches will increase the maintenance cost, and the confusion of business logic will also make it difficult to advance the work. In addition, the coding itself has a certain degree of freedom. Different coding habits and self-restraints will also make the code difficult to maintain and the handover difficult, which greatly increases the unfavorable factors of the system in the later stage. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the programming system and method for assembly and integration based on decompilation features provided by the present invention solve the problems of too many branches, difficult product maintenance, too high work complexity, and difficulty in later code management and handover in the existing programming process.
[0005] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is: a programming system for assembly and integration based on decompilation features, including a plug-in storage module and an assembly and integration module;
[0006] The plug-in storage module is a collection of pre-developed software application programs;
[0007] The assembly and integration module calls the corresponding software application set from the plug-in storage module to assemble and integrate according to the program design requirements to realize the program design;
[0008] The assembly integration module includes a process startup unit, a service inspection unit, a file detection unit, a method addressing unit, a software hot loading unit and a cache queue unit.
[0009] Furthermore, the process startup unit is used to open up an independent memory space and create a programming process according to the host runtime library;
[0010] The service checking unit is used to check the service connection status and operation status;
[0011] The file detection unit is used to monitor the assembly files in the plug-in storage module, record the assembly files moved in / out, and send them to the cache queue unit;
[0012] The method addressing unit is used to decompile the assembly file sent to the cache queue unit, and process the assembly file detailed information obtained after decompilation into a special format, and push it to the software hot loading unit in the form of a message;
[0013] The cache queue unit is used to store the assembly file information, and according to the queue first-in first-out principle, push the plug-in module information moved in or out to the software hot loading unit in sequence;
[0014] The software hot reload unit is used to read the pushed plug-in module information in sequence, create a thread initialization module using the decompilation feature, run the module program, and push the execution result to the database.
[0015] Furthermore, each assembly file in the plug-in storage module corresponds to a txt file and is configured with a corresponding version number.
[0016] A programming method for a programming system for assembling and integrating programming based on decompilation features, comprising the following steps:
[0017] S1. configuring a collection of pre-developed software applications in a plug-in repository module;
[0018] S2. Determine programming requirements;
[0019] S3. According to the program design requirements, the corresponding assembly files are extracted from the plug-in storage module for assembly and integration to obtain the required program.
[0020] Furthermore, the step S3 includes the following sub-steps:
[0021] S3-1, create a programming process through the process startup unit, and check the service connection status and operation status through the service check unit;
[0022] S3-2, monitoring the assembly files in the plug-in storage unit through the file detection unit, recording the assembly files moved in and out, and sending them to the cache queue unit;
[0023] S3-3, decompile the assembly file sent to the cache queue unit through the method addressing unit, and push the decompiled assembly file as a message to the software hot loading unit according to the queue first-in first-out principle;
[0024] S3-4. Based on the decompilation result of the assembly, the plug-in module information pushed by the cache queue unit is read in sequence by the software hot loading unit to load and unload the assembly file, and the thread initialization module is created by using the decompilation feature, the module program is run to obtain the required program, and the execution result is pushed to the database.
[0025] Furthermore, in step S3-1, the method for creating a programming process is specifically as follows:
[0026] In the SKD development environment, with the help of IWebHostBulider and IWebHost objects, start the host's WebHost object, then call the CreateHostBuilder() call stack, build a HostBuilder at the same time, and execute the host's loading operation to realize the creation of the programming process;
[0027] In step S3-1, the method of checking the service status and operation status is specifically as follows:
[0028] Create a background through Task, read the IP port, use Telnet to send instructions to the database and cache service, use RabbitMqClient to push and read elements regularly according to the queue URL, switch, and check the connection status and operation status of the service through exception capture and message status.
[0029] Furthermore, in step S3-2, the method for monitoring the assembly file is specifically as follows:
[0030] Through the System.IO.DirectoryInfo object, the assembly files under the running program are read in sequence, the file information of the assembly files is extracted and stored as sample data, the assembly files are read regularly and compared with the sample data to determine whether the files have changed, and the changed file information is synchronized to the sample data, and the changed plug-ins are pushed to the cache queue unit as plug-ins moved in or out;
[0031] The file information includes file size, creation time, and last write time.
[0032] Furthermore, in step S3-3, the method for decompiling the assembly is specifically as follows:
[0033] The assembly file is loaded through the Assembly.LoadFrom method, the collection of assembly objects is obtained through the GetTypes of the assembly object, the GetMethods of the Type object is looped to obtain all properties of each Type object, and the entry of each Type object is obtained through the Attribute identifier to implement assembly decompilation.
[0034] Furthermore, in step S3-4, the method for loading the assembly file is specifically as follows:
[0035] Read the changed and newly added assembly file information from the cache queue unit in turn, find the plugin address directory, reload the new version of the assembly file through AssemblyLoadContext.LoadFromAssembly, then recreate the assembly instance through Activator.CreateInstance(), and use Invoke to run the plugin;
[0036] The specific method for uninstalling the assembly file is as follows:
[0037] Use the AssemblyLoadContext assembly context to unload the assembly file through the UnLoad() function.
[0038] The beneficial effects of the present invention are:
[0039] (1) Short development cycle: The plug-in and component-based approach avoids changes to the entire program. The replaceable and removable design concept is used to replace plug-ins that meet functional scenarios, thereby achieving a dramatic reduction in development effort.
[0040] (2) Clear business logic: For internal plug-in management, the company adopts visualization and product introduction methods. Through differentiated comparison, the differences between different components can be clearly understood. Different scenarios correspond to different versions of the same module.
[0041] (3) Low later operation and maintenance costs: Due to the plug-in programming concept, when a problem occurs in the system, only a single plug-in needs to be modified and adjusted, and then replaced. The present invention adopts multi-branch complex code analysis to reduce code redundancy and highly reusable plug-ins, which reduces the processing difficulty and workload of developers;
[0042] (4) High universality: In terms of program design, the present invention adopts strategies such as multi-module separation, message queue notification, and data synchronization to achieve a design concept of high cohesion and low coupling. In addition, the multi-version and multi-scenario product list of the plug-in storage module makes the method of the present invention applicable in various industries and multi-scenario environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 This is a schematic diagram of the plug-in storage module provided by the present invention.
[0044] Figure 2 The present invention provides a flowchart of the programming method.
[0045] Figure 3This is a schematic diagram of program assembly and integration provided by the present invention. DETAILED DESCRIPTION
[0046] The specific implementation modes of the present invention are described below to facilitate those skilled in the art to understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.
[0047] Embodiment 1:
[0048] The embodiment of the present invention provides a programming system for assembly and integration based on decompilation features, including a plug-in storage module and an assembly and integration module;
[0049] The plug-in storage module is a collection of pre-developed software application programs;
[0050] The assembly and integration module calls the corresponding software application set from the plug-in storage module to assemble and integrate according to the program design requirements to realize the program design;
[0051] The assembly integration module includes a process startup unit, a service inspection unit, a file detection unit, a method addressing unit, a software hot loading unit and a cache queue unit; wherein the method addressing unit and the software hot loading unit are both based on decompilation as a technical support basis.
[0052] Based on the scheme of the present invention, after installing the SDK software development tool, in the process of software programming, there is no need to pay attention to the underlying processing method of decompilation. It provides a series of components. We only need to obtain its metadata (a table of specific data structures compiled by the program, which contains everything that describes the assembly definition) through these components, and then dynamically analyze the types, functions, methods and properties of the assembly to implement programming.
[0053] In the embodiment of the present invention, the process startup unit is used to open up an independent memory space according to the host runtime library and create a programming process; the purpose of creating the programming process here is to provide a hardware and software environment foundation for all subsequent modules;
[0054] The service checking unit is used to check the service connection status and operation status; the service here refers to the non-intuitive service that ensures the normal operation of the programming function, such as network communication checking, database connection checking, video background buffering and log recording;
[0055] The file detection unit is used to monitor the assembly files in the plug-in storage module, record the assembly files moved in and out, and send them to the cache queue unit;
[0056] The method addressing unit is used to decompile the assembly file sent to the cache queue unit, and process the detailed information of the assembly file obtained after decompilation into a special format, and push it to the software hot loading unit in the form of a message; specifically, the method addressing unit decompiles the assembly, obtains the name, method, attributes and finds the module entry identifier.
[0057] The cache queue unit is used to store the assembly file information, and according to the queue first-in first-out principle, push the plug-in module information moved in or out to the software hot loading unit in sequence; the assembly file here refers to the pre-developed software assembly in the plug-in storage module, and the plug-in module information refers to one or more assembly files to form a plug-in information;
[0058] The software hot loading unit is used to read the pushed plug-in module information in sequence, and use the decompilation feature to create a thread initialization module, run the module program, and push the execution result to the database; the creation of the thread initialization module here refers to the interface provided by the system call operating system. When creating a thread (also called a task), the assembly file is loaded into the memory, and memory space, time slice, and stack are allocated for it (each program running consumes the hardware resources of the computer);
[0059] In the embodiment of the present invention, Figure 1 As shown, the plug-in repository module is a collection of pre-developed software application programs (imagine it as a system, which may include login, business processing, problem consultation, business feedback, system settings, announcements, etc., and the program support for this series of business blocks that constitute the system is the software application program collection).
[0060] The plug-in storage module in this embodiment has a high degree of freedom in management and is not limited to one processing method. Each assembly file in the plug-in storage module corresponds to a txt file and is configured with a corresponding version number. Users can customize its specific content; each assembly is configured with a difference specification, a logic specification, a source code control and an assembly. The present invention can form a high-level assembly through a multi-angle and all-round combination of the plug-in storage module.
[0061] In an embodiment of the present invention, similar plug-ins under the plug-in storage module can also develop versions of different dimensions through market research to meet the special needs of various industries such as medicine, civil, industry, finance, and government, and combine the characteristics of the enterprise to assemble a program product structure that can meet the needs of various industries, making it highly universal.
[0062] Embodiment 2:
[0063] The embodiment of the present invention provides a method for implementing program design based on the system structure in embodiment 1, such as Figure 2 As shown, the following steps are included:
[0064] S1. configuring a collection of pre-developed software applications in a plug-in repository module;
[0065] S2. Determine programming requirements;
[0066] S3. According to the program design requirements, the corresponding assembly files are extracted from the plug-in storage module for assembly and integration to obtain the required program.
[0067] like Figure 3 As shown, step S3 in the embodiment of the present invention includes the following sub-steps:
[0068] S3-1, create a programming process through the process startup unit, and check the service connection status and operation status through the service check unit;
[0069] S3-2, monitoring the assembly files in the plug-in storage unit through the file detection unit, recording the assembly files moved in and out, and sending them to the cache queue unit;
[0070] S3-3, decompile the assembly file sent to the cache queue unit through the method addressing unit, and push the decompiled assembly file as a message to the software hot loading unit according to the queue first-in first-out principle;
[0071] S3-4, based on the decompilation result of the assembly, the software hot loading unit sequentially reads the plug-in module information pushed by the cache queue unit to load and unload the assembly file, and uses the decompilation feature to create a thread initialization module, runs the module program to obtain the required program, and pushes the execution result to the database. In step S3-1 of this embodiment, the method for creating a programming process is specifically as follows:
[0072] In the SKD development environment, with the help of IWebHostBulider and IWebHost objects, start the host's WebHost object, then call the CreateHostBuilder() call stack, build a HostBuilder at the same time, and execute the host's loading operation to realize the creation of the programming process;
[0073] In step S3-1 of this embodiment, the method of checking the service status and operation status is specifically as follows:
[0074] Create a background through Task, read the IP port, use Telnet to send instructions to the database and cache service, use RabbitMqClient to push and read elements regularly according to the queue URL, switch, and check the connection status and operation status of the service through exception capture and message status.
[0075] In step S3-2 of this embodiment, the method for monitoring the assembly file is specifically as follows:
[0076] Through the System.IO.DirectoryInfo object, the assembly files under the running program are read in sequence, the file information of the assembly files is extracted and stored as sample data, the assembly files are read regularly and compared with the sample data to determine whether the files have changed, and the changed file information is synchronized to the sample data, and the changed plug-ins are pushed to the cache queue unit as plug-ins moved in or out;
[0077] The file information includes file size, creation time, and last write time.
[0078] In step S3-3 of this embodiment, the method for decompiling the assembly is specifically as follows:
[0079] The assembly file is loaded through the Assembly.LoadFrom method, the collection of assembly objects is obtained through the GetTypes of the assembly object, the GetMethods of the Type object is looped to obtain all properties of each Type object, and the entry of each Type object is obtained through the Attribute identifier to implement assembly decompilation; wherein, the assembly object refers to a file that is generated after the assembly file is instantiated and can be operated on.
[0080] In step S3-4 of this embodiment, the method for loading the assembly file is specifically as follows:
[0081] Read the changed and newly added assembly file information from the cache queue unit in turn, find the plugin address directory, reload the new version of the assembly file through AssemblyLoadContext.LoadFromAssembly, then recreate the assembly instance through Activator.CreateInstance(), and use Invoke to run the plugin;
[0082] The specific method for uninstalling the assembly file is as follows:
[0083] Use the AssemblyLoadContext assembly context to unload the assembly file through the UnLoad() function.
[0084] The above-mentioned programming method provided by the embodiment of the present invention solves the shortcomings of the traditional programming development by establishing project branches, including long development cycle, mixed project business logic, high later operation and maintenance costs, and the deletion of functions involving the annotation and modification of the code. Developers write the same function block multiple times, lack of unified management of product functions, and confusion of functions, which will lead to increased risks of later programs.
[0085] In the description of the present invention, it is necessary to understand that the orientation or positional relationship indicated by the terms "center", "thickness", "upper", "lower", "horizontal", "top", "bottom", "inner", "outer", "radial", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, the terms "first", "second", and "third" are used only for descriptive purposes, and cannot be understood as indicating or implying the relative importance or the number of implicitly specified technical features. Therefore, the features defined by "first", "second", and "third" may explicitly or implicitly include one or more of the features.
Claims
1. A programming method for assembling and integrating based on decompilation features, characterized in that: The system for implementing the programming method comprises: Plug-in storage module and assembly integration module; The plug-in repository module is a collection of pre-developed software application programs; The assembly and integration module calls the corresponding software application set from the plug-in storage module to assemble and integrate according to the program design requirements to realize the program design; The assembly integration module includes a process startup unit, a service inspection unit, a file detection unit, a method addressing unit, a software hot loading unit and a cache queue unit; The process startup unit is used to open up an independent memory space and create a programming process according to the host runtime library; The service checking unit is used to check the service connection status and operation status; The file detection unit is used to monitor the assembly files in the plug-in storage module, record the assembly files moved in / out, and send them to the cache queue unit; The method addressing unit is used to decompile the assembly file sent to the cache queue unit, and process the assembly file detailed information obtained after decompilation into a special format, and push it to the software hot loading unit in the form of a message; The cache queue unit is used to store the assembly file information, and according to the queue first-in first-out principle, push the plug-in module information moved in or out to the software hot loading unit in sequence; The software hot reload unit is used to read the pushed plug-in module information in sequence, create a thread initialization module using the decompilation feature, run the module program, and push the execution result to the database; Each assembly file in the plug-in storage module corresponds to a txt file and is configured with a corresponding version number; The programming method comprises the following steps: S1. configuring a collection of pre-developed software applications in a plug-in repository module; S2. Determine programming requirements; S3. According to the program design requirements, the corresponding assembly files are extracted from the plug-in storage module for assembly and integration to obtain the required program; The step S3 comprises the following sub-steps: S3-1, create a programming process through the process startup unit, and check the service connection status and operation status through the service check unit; S3-2, monitoring the assembly files in the plug-in storage unit through the file detection unit, recording the assembly files moved in and out, and sending them to the cache queue unit; S3-3, decompile the assembly file sent to the cache queue unit through the method addressing unit, and push the decompiled assembly file as a message to the software hot loading unit according to the queue first-in first-out principle; S3-4. Based on the decompilation result of the assembly, the software hot loading unit sequentially reads the plug-in module information pushed by the cache queue unit to load and unload the assembly file, and uses the decompilation feature to create a thread initialization module, runs the module program to obtain the required program, and pushes the execution result to the database; In step S3-1, the method for creating a programming process is specifically as follows: In the SKD development environment, with the help of IWebHostBulider and IWebHost objects, start the host's WebHost object, then call the CreateHostBuilder() call stack, build a HostBuilder at the same time, and execute the host's loading operation to realize the creation of the programming process; In step S3-1, the method of checking the service status and operation status is specifically as follows: Create a background through Task, read the IP port, use Telnet to send instructions to the database and cache service, use RabbitMqClient to push and read elements regularly according to the queue URL, switch, and check the connection status and operation status of the service through exception capture and message status; In step S3-3, the method for decompiling the assembly is specifically as follows: The assembly file is loaded through the Assembly.LoadFrom method, the collection of assembly objects is obtained through the GetTypes of the assembly object, the GetMethods of the Type object is looped to obtain all properties of each Type object, and the entry of each Type object is obtained through the Attribute identifier to implement assembly decompilation; wherein, the assembly object refers to a file that is generated after the assembly file is instantiated and can be operated on.
2. The programming method according to claim 1, characterized in that: In step S3-2, the method for monitoring the assembly file is specifically as follows: Through the System.IO.DirectoryInfo object, the assembly files under the running program are read in sequence, the file information of the assembly files is extracted and stored as sample data, the assembly files are read regularly and compared with the sample data to determine whether the files have changed, and the changed file information is synchronized to the sample data, and the changed plug-ins are pushed to the cache queue unit as plug-ins moved in or out; The file information includes file size, creation time, and last write time.
3. The programming method according to claim 1, characterized in that: In step S3-4, the method for loading the assembly file is specifically as follows: Read the changed and newly added assembly file information from the cache queue unit in turn, find the plugin address directory, reload the new version of the assembly file through AssemblyLoadContext.LoadFromAssembly, then recreate the assembly instance through Activator.CreateInstance(), and use Invoke to run the plugin; The specific method for uninstalling the assembly file is: Use the AssemblyLoadContext assembly context to unload the assembly file through the UnLoad() function.
