A method for dynamically executing business system functions

By creating object pools in the ERP system and loading source code into memory, dynamically adjusting and updating business logic, the ERP system's lack of flexibility in customer personalized needs is solved, and the rapid response to customer needs and shortening development cycles is achieved. Effect.

CN114693275BActive Publication Date: 2025-02-21INSPUR GENERSOFT CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210405141.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-18
Publication Date
2025-02-21
Estimated Expiration
2042-04-18

AI Technical Summary

Technical Problem

The existing ERP system lacks flexible business logic adjustment solutions in customer personalized needs, resulting in long development cycles, high costs, and difficult to meet the needs of customers' rapid change.

Method used

By creating an object pool, the source code of the business system is loaded into memory to generate memory objects, and the call index is provided through the object pool, supporting dynamic adjustment and update of business logic without redeployment of code.

Benefits of technology

It realizes the creation or modification of business functions without adding new code files, supports quick response to customer needs, shortens the development cycle, and implements tenant-based isolation under SaaS deployment, avoiding functional confusion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114693275B_ABST
    Figure CN114693275B_ABST
Patent Text Reader

Abstract

The present invention proposes a method for dynamically executing business system functions, including: creating an object pool according to the source code of the business system; loading the source code into the memory to generate a memory object, associating the memory object with the object pool, and providing a call index of the memory object through the object pool; in response to a change in the source code of the business system, loading the changed source code into the memory to generate a new memory object; and updating the new memory object to the object pool. The method for dynamically executing business system functions provided by the present invention supports the creation of a new business function without adding a new code file, and mounting it on a business document to realize a new function; supports modifying the existing business function logic without redeploying the code, thereby modifying the existing function; changes in business functions can achieve tenant-based isolation, and changes between each other will not affect each other.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of ERP enterprise management software, and specifically to a business system function dynamic execution method. Background Art

[0002] In the ERP system, implementation and deployment have always been the top priority. Based on the standard products, project managers and implementation consultants will adjust the functions of standard products according to the customer's on-site survey to adapt to the customer's actual scenario. At present, most manufacturers provide some low-code tools to support dynamic adjustment of database table fields, models and interfaces, but the business logic cannot be adjusted. Generally, in this case, it is necessary to sign a secondary development contract with the customer, and the developer will develop on-site or remotely to meet the customer's needs. After the development is completed, the new code program will be packaged and made into a program patch, and the patch will be installed in the customer's production environment to meet the customer's needs. This method has a large workload and a long work cycle. Under normal circumstances, the fastest cycle is 3 to 10 days, and some may even take several months. After the development is completed, the implementation process may be adjusted repeatedly, which brings a great risk of delay to the project delivery cycle, and customer satisfaction is likely to be low. Summary of the invention

[0003] To solve the above problems, the present invention proposes a method for dynamically executing a business system function, comprising:

[0004] Create an object pool based on the source code of the business system;

[0005] Loading the source code into a memory to generate a memory object, associating the memory object with the object pool, and providing a call index of the memory object through the object pool;

[0006] In response to a change in source code of the business system, loading the changed source code into a memory to generate a new memory object; and

[0007] The new memory object is updated to the object pool, and the corresponding call index is updated.

[0008] In some implementations of the present invention, creating an object pool according to the structure of the source code of the business system includes:

[0009] Obtain source code files of each module in the business system;

[0010] An object pool is created based on the code structure in all of the source code files.

[0011] In some embodiments of the present invention, creating an object pool based on the code structures in all the source code files includes:

[0012] Creating an object pool based on the classes in the source code file; and

[0013] In response to the presence of non-class structured code in the source code file associated with the module, an object pool is created based on the source code file.

[0014] In some embodiments of the present invention, loading the source code into a memory to generate a memory object, and associating the memory object with the object pool comprises:

[0015] The source code is loaded into the memory in units of methods and the memory address of the method in the memory is bound to the object pool.

[0016] In some embodiments of the invention, the method further comprises:

[0017] Creating an object pool associated database according to the object pool;

[0018] Analyze key information of the source code corresponding to the object pool, and save the key information to the object pool associated database.

[0019] In some embodiments of the invention, the method further comprises:

[0020] The corresponding source code is loaded from the object pool associated database into the memory to generate a memory object corresponding to the source code, and the memory object is associated with the object pool.

[0021] In some embodiments of the invention, the method further comprises:

[0022] Providing a remote code modification interface, through which the source code in the object pool associated database is updated and / or created;

[0023] Loading the updated and / or created source code into memory to generate a new memory object;

[0024] Bind the new memory object to the object pool.

[0025] In some embodiments of the invention, the method further comprises:

[0026] In response to a change in the source code of the business system, performing a security check on the changed source code;

[0027] The source code with the security verification result being passed is loaded into the memory and saved into the object pool associated database.

[0028] In some embodiments of the invention, the method further comprises:

[0029] The calling time of the memory object is recorded, and in response to the memory object not being called within a predetermined time, the memory object in the object pool is released.

[0030] In some embodiments of the invention, the method further comprises:

[0031] The source code of the memory object is added to an object pool. In response to the memory object not existing in the object pool, the object pool loads the source code corresponding to the memory object from the object pool into a memory to generate a corresponding memory object.

[0032] The method for dynamically executing business system functions provided by the present invention supports creating a new business function without adding a new code file, and mounting it on a business document to implement the new function; supports modifying the existing business function logic without redeploying the code, so as to modify the existing function; changes in business functions can be isolated based on tenants under SaaS deployment, and changes between each other will not affect each other. For the changing needs of customers, it can be quickly customized on-site according to needs and directly applied to the customer's business system. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0034] Figure 1 A flowchart of a method for dynamically executing a business system function provided by an embodiment of the present invention;

[0035] Figure 2 A schematic diagram of an embodiment of a method for dynamically executing a business system function provided by an embodiment of the present invention;

[0036] Figure 3 A schematic diagram of an embodiment of a method for dynamically executing a business system function provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0037] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0038] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.

[0039] In the current ERP system, the personalized needs of customers generally include the following aspects: interface style and personalized field level, data flow level of documents and materials, and personalized business logic. For the first two, industry manufacturers often provide implementation tools to meet them, such as low-code platforms, form tools, workflow tools, document conversion tools, etc. These tools can support rapid adjustments to meet customer needs at the customer site without adjusting the code. For personalized business logic development, there is currently no better implementation solution that can achieve rapid adjustments. The general practice is to sign a secondary development contract with the customer, and the implementation consultant or development engineer will encode according to customer needs to form a code file, and according to the software patch release process, make general or private patches, and test the patches. After the test passes, the patches will be installed and deployed to the customer to meet business needs.

[0040] The reasons why it is impossible to form a better personalized business logic dynamic adjustment are as follows: First, due to the current status of programming languages, the commonly used programming languages ​​are divided into compiled languages ​​and interpreted languages. Generally, compiled languages ​​require a compiler to translate the source code into machine code first, and then execute the machine code at runtime to implement the function. Interpreted languages ​​do not need to be compiled in advance, but the interpreter still needs to read and translate the source code file line by line and execute it by the CPU. Both programming language styles require the developer to write the source code first. Once the source code is deployed, it cannot be dynamically changed during operation. Therefore, it is impossible to modify the business logic without the customer modifying the code, which means that the dynamic business functions of ERP cannot be adjusted in real time.

[0041] like Figure 1 As shown, the present invention proposes a method for dynamically executing a business system function, comprising:

[0042] Step S1, creating an object pool according to the source code of the business system;

[0043] Step S2, loading the source code into a memory to generate a memory object, associating the memory object with the object pool, and providing a call index of the memory object through the object pool;

[0044] Step S3, in response to a change in the source code of the business system, loading the changed source code into a memory to generate a new memory object; and

[0045] Step S4: Update the new memory object to the object pool, and update the corresponding call index.

[0046] In an embodiment of the present invention, in step S1, the main software process of the system implemented based on the method of the present invention will scan the module list registered to the system in sequence, and load the code under the module in sequence according to the dependency order of the module. Taking Python language as an example, the __init__.py file under the module directory is mainly used to describe which class files under this module are loaded. An object pool is created according to the business logic structure in the code under each module directory, that is, there are also multiple modules in the object pool, and the multiple modules correspond to each module in the project one by one, and the objects described under each module also correspond to the source code in each module in the project one by one. The relationship between the objects in the object pool and each module of the project is one by one.

[0047] In step S2, after the object pool is constructed, the source code is loaded into the memory to generate a memory object, and the address of the memory object in the memory is bound to the corresponding object in the corresponding object pool. When the memory object is needed, the corresponding object in the object pool is used to find the memory object in the memory corresponding to the object and execute the corresponding logic to realize the business needs. The memory object refers to a program with certain logic processing capabilities loaded into the memory by the source code.

[0048] In steps S3 and S4, if a module in the system or part of the code inside a module is changed, the changed code is directly loaded into the memory to generate a new memory object, and then the address of the new memory object is bound to the corresponding object in the object pool. When the object is subsequently called, it directly points to the new memory object of the object in the memory, and the new memory object implements the function of the changed business logic. Therefore, when the requirements change, the modified code can be directly loaded into the memory for use, and the corresponding functions can be flexibly changed directly.

[0049] In some implementations of the present invention, creating an object pool according to the structure of the source code of the business system includes:

[0050] Obtain source code files of each module in the business system;

[0051] An object pool is created based on the code structure in all of the source code files.

[0052] In some embodiments of the present invention, creating an object pool based on the code structures in all the source code files includes:

[0053] Creating an object pool based on the classes in the source code file; and

[0054] In response to the presence of non-class structured code in the source code file associated with the module, an object pool is created based on the source code file.

[0055] In some embodiments of the present invention, loading the source code into a memory to generate a memory object, and associating the memory object with the object pool comprises:

[0056] The source code is loaded into the memory in units of methods and the memory address of the method in the memory is bound to the object pool.

[0057] In this embodiment, the main process of the software maintains an object pool, and adds all scanned class objects, field attributes of class objects, and methods of class objects to the object pool. In order to make up for the shortcomings of the Python interpreter for object management, the business objects in the system are pre-cached to ensure that the objects can be read directly from the memory when they are used. The objects in the object pool will be named with a globally unique key. When the system needs to use this object, it will obtain the object through the key. The field attributes and methods of the object are copied from a template base class, including the attributes of the base class, such as ID, creation time, creator, modification time and modifier, and the general methods of the template base class, such as Create, Write, Search, Search_count, Browse, Submit, Approve, Delete, Submit_Cancel, Approve_Cancel, etc.

[0058] In some embodiments of the present invention, according to the object attributes and object methods defined in the source code file, the object's special attributes and methods are bound to the objects in the memory object pool. For example, the voucher object will have voucher word attributes, business date attributes, reviewer, submitter, voucher number attributes, etc.

[0059] In addition, the custom methods of the objects defined in the source code file will be bound to the objects in the memory object pool. For example, the voucher object will have voucher posting methods, voucher review methods, voucher cancellation methods, etc.

[0060] Specifically, taking Python language as an example, before adding the object method to the object pool, the static code can be read. This can be achieved by using the Python language built-in function getattr(). The getattr() function is used to return an object attribute value. Since the static code becomes a memory object after being scanned by the interpreter, this object can be obtained through this method.

[0061] In some embodiments of the invention, the method further comprises:

[0062] Creating an object pool associated database according to the object pool;

[0063] Analyze key information of the source code corresponding to the object pool, and save the key information to the object pool associated database.

[0064] In this embodiment, creating an object pool associated database based on an object pool is to save the object information in the object pool in a database. The information of the objects in the object pool and the structural relationship of the objects are saved in a database, and the saved key information includes but is not limited to the following attributes:

[0065] a) Function name, i.e. the business name of the function, is used for easy query during management. It can be marked with a special marker when the function is coded. If not marked, it is equal to the technical name of the function;

[0066] b) The name of the model to which the function belongs, that is, the object name, which is used to facilitate searching by object during management;

[0067] c) The name of the module to which the function belongs, that is, the module name, which is used for management and easy search by module;

[0068] d) The technical name of the function, that is, the name corresponding to the function's def, which is obtained through getattr during execution;

[0069] e) The function's input parameter list, that is, the input parameter list during def, is used for verification during execution and troubleshooting during management;

[0070] f) The source code content of the function, i.e. the source code, is used for viewing during management and also provides editing functions for runtime customization;

[0071] g) The server file path and file name to which the function belongs, that is, the physical file path corresponding to the source code. Once the source code is modified abnormally, the source file can be quickly obtained through this path and restored.

[0072] h) The MRO inheritance chain list of the function, which corresponds to Python's MRO inheritance chain, is used to quickly locate problems during management. At the same time, the order of the inheritance chain will also control that only the last level of inheritance can modify the code to prevent abnormal situations.

[0073] In some embodiments of the present invention, the key information of the object pool is saved in a database table, and the database table is expanded to add the following fields:

[0074] a) Primary key ID;

[0075] b) The key information (attributes) listed above;

[0076] c) Tenant ID;

[0077] d) Whether the flag has been modified dynamically (mainly used to distinguish whether the function has been dynamically modified by the later implementation personnel);

[0078] According to the model name and function name, it is retrieved whether the database table row entry corresponding to the function object already exists in the database. If it already exists, it is necessary to determine whether the flag has been dynamically modified. If it has been modified, the database should be used as the basis and no update should be performed. If it has not been modified, the static code should be used as the basis for update; if the entry does not exist, it will be inserted into the database for persistent storage.

[0079] In some embodiments of the invention, the method further comprises:

[0080] The corresponding source code is loaded from the object pool associated database into the memory to generate a memory object corresponding to the source code, and the memory object is associated with the object pool.

[0081] In this embodiment, the object pool associated database stores all the source code of the system. When the system is deployed or part of the system code is modified remotely, it can be directly loaded into the memory through the code in the database. Specifically, taking Python language as an example, the source code can be read from the database as a string through the Python built-in function exec, and loaded into the memory as a parameter of the exec function to deploy the entire system or modify the code of certain functions to generate a memory object and update it to the object pool. In this embodiment, the exec function is a Python built-in function that can dynamically compile a string type of source code into an executable memory program at runtime.

[0082] In some embodiments of the invention, the method further comprises:

[0083] Providing a remote code modification interface, through which the source code in the object pool associated database is updated and / or created;

[0084] Loading the updated and / or created source code into memory to generate a new memory object;

[0085] Bind the new memory object to the object pool.

[0086] In this embodiment, an interface for remotely modifying code is provided based on the structure of an object-associated database, including providing an interface with function as the granularity, and calling the function that can be used for remote modification a dynamic function. At the same time, a search interface is provided to provide quick positioning for querying the function. The search method can be searched according to the key information corresponding to the object collected when the object is established in the above embodiment. After the corresponding dynamic function is determined after the search, the dynamic function can be modified. The dynamic function management interface is convenient for rapid customization and modification at the customer site. The management interface provides a list interface, and the list interface supports filtering. It can be filtered according to the module name, model name, function name, server file path and name to which the function belongs. Further, the management interface supports clicking on an item in the list to penetrate to the detailed interface of the business function data. In the detailed interface, the stored data can be viewed, modified and edited. Some fields are set to be protected, such as the module to which the function belongs and the model to which the function belongs. These fields do not support dynamic adjustment. In the detailed interface of the business function, the activation status of the business function can be set. Only the function in the activated state will be mounted to the business model at startup and can be executed and called. Business functions can be switched back and forth between activated and frozen states to meet actual business needs.

[0087] In some embodiments of the present invention, Figure 3 As shown, a modification interface for the source code content of the dynamic function is provided through the web interface. After the modification is completed, the corresponding run button can be directly clicked to directly load the modified dynamic function into the memory through the exec function to generate a memory object, and further associate the memory object with the object pool. When the business system calls the dynamic function, the address of the regenerated memory object is fed back to the caller to pass the corresponding parameters for execution.

[0088] In some embodiments of the present invention, dynamic functions are generally defined as functions whose modification affects the operation of other functions. They are usually functions of the class with the lowest inheritance concern in the multiple inheritance structure of classes. Modifications to them will only affect the functions corresponding to the instances of this class, but will not affect the operation of instances of other classes.

[0089] In addition, when changes in business requirements involve modifying the method relationship of a function belonging to a parent class in the class inheritance relationship, it is necessary to consider the entire subclass of the class before making the modification. At the same time, for such modifications, it is necessary to set the authority of the modifier in the object pool association database for control to prevent malicious modifications that may cause abnormalities in the business system.

[0090] In some embodiments of the present invention, the scope of the dynamic function is determined by the MRO inheritance chain of objects in the object pool. The corresponding inheritance relationship can be used to determine whether the class to which the dynamic function belongs has a sub-inheritance class. If so, all methods of the class are set to non-dynamic functions.

[0091] In some embodiments of the invention, the method further comprises:

[0092] In response to a change in the source code of the business system, performing a security check on the changed source code;

[0093] The source code with the security verification result being passed is loaded into the memory and saved into the object pool associated database.

[0094] In this embodiment, when the source code of a business system is changed, a security verification operation is performed on the changed code, including verification of the following key elements:

[0095] a) Verify whether the function name is correct, mainly to ensure that it does not duplicate existing data, and whether there are sensitive words or system reserved words

[0096] b) Check whether the function's input parameter variables are accurate, mainly to ensure that multiple input parameters have no duplicate names and whether the input parameters contain sensitive words and system reserved words

[0097] c) Verify the legality of the source code. Check whether the newly written source code references the system preset blacklist library, whether it contains dangerous operations, whether some high-risk system functions are called, etc.

[0098] d) Based on step c), it is necessary to maintain a list of blacklist libraries, such as sys, os, etc. These libraries have extensive permissions and can restart the server, delete services, etc. If used carelessly, they can easily bring security risks.

[0099] e) Verify the legality of the source code, mainly checking the language. In the Python version implementation, the main consideration is to use the pep8 (Python language source code standard) specification to check whether the code is legal.

[0100] In addition, in some embodiments of the present invention, in the management interface of dynamic functions, in the business function list interface and the details interface, you can select a certain entry function and copy it. The copied function will automatically add the _copy suffix to ensure that there will be no functions with the same name. By default, the copied function is in a frozen state and cannot be executed directly. It needs to be adjusted by the developer and pass the legality check before it can be enabled.

[0101] Further, the function of adding a new business function is provided in the business function list interface. After clicking on the function, the interface of adding a new function is entered, and the module and model are selected in turn. After filling in other necessary fields, the verification described above is performed. After the verification passes, it can be saved successfully. In some embodiments of the present invention, the method also includes:

[0102] The calling time of the memory object is recorded, and in response to the memory object not being called within a predetermined time, the memory object in the object pool is released.

[0103] In this embodiment, the calling status of the corresponding memory objects in the object pool is counted. Whenever a memory object is called, the timing starts, and the timing will be restarted when a call occurs. When the timing value exceeds a predetermined value, it means that the memory object is less frequently used, and the memory object is released from the memory.

[0104] In some embodiments of the invention, the method further comprises:

[0105] The source code of the memory object is added to an object pool. In response to the memory object not existing in the object pool, the object pool loads the source code corresponding to the memory object from the object pool into a memory to generate a corresponding memory object.

[0106] In this embodiment, the source code corresponding to the memory object running in the memory is also added to the object pool. If the memory object bound in the object pool is empty, for example, in some cases, the function corresponding to the memory object has not been called for a long time and is released. When it is suddenly called, the object pool does not have the memory object of the function and needs to obtain the corresponding source code to load into the memory. In this case, the source code saved for the object in the object pool can be directly loaded into the memory to generate a memory object, and then the memory object is bound to the object pool. It can be directly called and executed.

[0107] In some embodiments of the present invention, the present invention also provides a function of isolating dynamic function codes according to tenants at runtime.

[0108] Generally, in a customer's environment, there are multiple account sets (account sets refer to different customers served by the system provider, such as the same ERP business system maintained for multiple enterprises). Different account sets may have different business implementations for the same method of the same business model. If they are not isolated, it will cause confusion in function implementation and lead to business errors. The present invention takes this situation into full consideration and provides a function of isolating different tenants on the same application server. For the specific functional architecture, please refer to the attached Figure 2 .

[0109] When the business system is started, the database registered in the system is scanned first, and then corresponding object pools are created according to different databases. According to the example in the attached figure, for example, there are multiple account sets such as A, B, ..., Z in the system. For the same sales order business object, according to the respective definitions in the database, two dynamic function objects X0 and Y0 can be mounted to account set A (system owned by company A or users), three dynamic function objects X1, Y1, and W1 can be mounted to account set B (system owned by company B or users), and three dynamic function objects X9, Y9, and U9 can be mounted to account set Z (system owned by company Z or users). The number and content of these dynamic functions are different. When users visit three different account sets respectively, different functions can be realized respectively. With the help of corresponding dynamic form definitions, different functions can be mounted as different buttons respectively. The model definitions and function objects corresponding to the models between different account sets can be different. Due to the implementation of the isolation mechanism, functional confusion and unavailability will not be caused.

[0110] In addition, it should be noted that the object pool-associated database method can be used to quickly and accurately deploy services for the business system. On the computer, the corresponding local or remote database can be quickly accessed through remote database access and loaded directly into the memory without the need to import source code files or compiled executable files from the local. The object pool-associated database method can be used to manage the business system code safely and efficiently.

[0111] The following is an exemplary embodiment of the present invention:

[0112] In a certain enterprise information system, the project manager found after on-site investigation that the customer required the sales order module in our system. Once the sales order was approved, it was necessary to call an interface of a heterogeneous system to change the business opportunity status of the corresponding customer in the other party's system to the signed status. After communicating with the on-site implementation personnel, the project manager implemented the customer's needs through the following steps:

[0113] 1. First, the developer needs to write the test code for calling the opportunity write-back asynchronous interface locally and pass the self-test. This process takes 1 day.

[0114] 2. The developer opens the ERP system, searches for all functions under the corresponding model according to the sales module->sales order model, and then searches for the svc_confirm() function. Edit the code window of this function through the interface, copy the code in 1 to the bottom of this field, and check whether the format is correct.

[0115] 3. The developer clicks Save, and the system automatically performs a code security check. After the check passes, the code is saved successfully.

[0116] 4. When the developer clicks the [Activate] button in the system, the system automatically loads the newly edited code and it takes effect immediately.

[0117] 5. The implementation staff conducts joint debugging and testing with the customer to ensure that the system functions normally, that the requirements can meet customer needs, and that the functions are implemented.

[0118] If there is no dynamic ERP dynamic function implementation solution that supports real-time adjustment provided by this solution, then in step 2, developers need to switch to the designated code branch in the local code branch first to develop local code. After the development is completed, it cannot take effect immediately and patches need to be made and released to the customer system. This process will last at least 3 days. It is conceivable that hundreds of such function development and adjustment processes will definitely bring a lot of optimization of delivery efficiency. Moreover, the adjustment of this solution will only affect the account set of one account. For other system account sets deployed on the same server as the enterprise, the method of calling this asynchronous interface will not be called after the order is confirmed, which achieves effective isolation, which is also impossible to achieve with traditional solutions. Therefore, the implementation of this solution can bring good benefits.

[0119] As described above, the method for dynamically executing business system functions provided by the present invention supports creating a new business function without adding a new code file, and mounting it on a business document to implement a new function; supports modifying the existing business function logic without redeploying the code, thereby modifying the existing function; changes in business functions can be isolated based on tenants under SaaS deployment, and changes between each other will not affect each other. For the changing needs of customers, it can be quickly customized on-site according to needs and directly applied to the customer's account system.

[0120] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope disclosed in the embodiments of the present invention as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.

[0121] It should be understood that, as used herein, the singular forms "a", "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations including one or more of the associated listed items.

[0122] The serial numbers of the embodiments disclosed in the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0123] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0124] A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present invention as described above, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.

Claims

1. A method for dynamically executing a business system function, characterized in that: include: Create an object pool based on the source code of the business system; Loading the source code into a memory to generate a memory object, associating the memory object with the object pool, and providing a call index of the memory object through the object pool; In response to a change in the source code of the business system, loading the changed source code into a memory to generate a new memory object; as well as Update the new memory object to the object pool, and update the corresponding call index; The creation of an object pool according to the source code of the business system includes: Obtain the source code files of each module in the business system; Creating an object pool based on the code structures in all the source code files; The creating an object pool based on the code structure in all the source code files comprises: Creating an object pool based on the classes in the source code file; and In response to the presence of non-class structured code in the source code file associated with the module, creating an object pool based on the source code file; Creating the object pool associated database according to the object pool; Analyzing key information of the source code corresponding to the object pool, and saving the key information to the object pool associated database; The corresponding source code is loaded from the object pool associated database into the memory to generate a memory object corresponding to the source code, and the memory object is associated with the object pool.

2. The method according to claim 1, characterized in that The step of loading the source code into a memory to generate a memory object and associating the memory object with the object pool comprises: The source code is loaded into the memory in units of methods and the memory address of the method is bound to the object pool.

3. The method according to claim 1, characterized in that Also includes: Providing a remote code modification interface, through which the source code in the object pool associated database is updated and / or created; Loading the updated and / or created source code into memory to generate a new memory object; Bind the new memory object to the object pool.

4. The method according to claim 1, characterized in that Also includes: In response to a change in the source code of the business system, performing a security check on the changed source code; The source code with a security verification result of passing is loaded into the memory and saved to the object pool associated database.

5. The method according to claim 1, characterized in that Also includes: The calling time of the memory object is recorded, and in response to the memory object not being called within a predetermined time, the memory object in the object pool is released.

6. The method according to claim 1, characterized in that Also includes: The source code of the memory object is added to an object pool. In response to the memory object not existing in the object pool, the object pool loads the source code corresponding to the memory object from the object pool into a memory to generate a corresponding memory object.

Citation Information

Patent Citations

  • Application program code processing method and device

    CN111880804A