Method, device, electronic device and storage medium for publishing middle platform application
By creating new tenant containers and associations in the middle-end system, the rapid release and hot deployment of middle-end applications is achieved, which solves the time-consuming release problem when upgrading the middle-end system functions and improves innovation efficiency and system flexibility.
Patent Information
- Application Number
- CN202111021746.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-01
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-09-01
AI Technical Summary
When the functions of the middle-end system are upgraded, the participants cannot independently control the release pace, and due to the large number of participants, the release takes a long time, which affects the innovation efficiency.
Propose a publishing method for middle-end applications. By obtaining the new version of the development package of the target participant, updating the version information in the running environment, creating a new tenant container, and establishing an association relationship, the new version of the development package will take effect and achieve hot release. and hot deployment, reducing resource consumption and time in the release process.
It achieves rapid and independent function release, reduces the resource pressure on the mid-end system during the release process, avoids restart operations, improves release efficiency and system flexibility, and supports the independence and resource isolation of multiple participants.
Smart Images

Figure CN113867776B
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of computer technology, and in particular, to a method, device, electronic device, and storage medium for publishing a middleware application. Background Art
[0002] The middle platform system is composed of a series of execution standards, operating mechanisms, configuration management and execution systems, and operation service teams, which provide all participants with the ability to innovate quickly and at low cost. After the establishment of the middle platform system, the R&D system has changed from "centralized development to improve its own R&D efficiency" to "distributed development to ensure global throughput and improve the R&D efficiency of participants", which has greatly improved the innovation efficiency of the participants. However, since the participants need to rely on the middle platform system when upgrading their own functions, they cannot independently control the rhythm of function releases; and the number of participants connected to the middle platform system is large, and the release takes a long time. Summary of the invention
[0003] In view of this, one or more embodiments of the present specification provide a method, device, electronic device and storage medium for publishing a middleware application.
[0004] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:
[0005] According to a first aspect of one or more embodiments of this specification, a method for publishing a middle-office application is proposed, which is applied to a middle-office system to which the middle-office application belongs. The middle-office application includes sub-applications corresponding to each participant, and the development kits of each sub-application are respectively in corresponding tenant containers. The method includes:
[0006] In response to a release request for a target sub-application corresponding to a target participant, obtaining a development kit of a new version of the target sub-application submitted by the target participant;
[0007] Updating the version information of the development kit for the target sub-application in the target operating environment where the middle platform application is located to the new version;
[0008] A new target tenant container is created based on the new version of the development kit, and an association relationship between the target sub-application and the new target tenant container is established, so that the new target tenant container is used to carry the new version of the development kit.
[0009] According to a second aspect of one or more embodiments of this specification, a publishing device for a middle platform application is proposed, including:
[0010] An acquisition unit, in response to a release request for a target sub-application corresponding to a target participant, acquires a development package of a new version of the target sub-application submitted by the target participant;
[0011] A version updating unit, used to update the version information of the development kit for the target sub-application in the target operating environment where the middle platform application is located from the old version to the new version;
[0012] The container creation unit creates a new target tenant container based on the new version of the development kit, and establishes an association relationship between the target sub-application and the new target tenant container, so that the new target tenant container is used to carry the new version of the development kit.
[0013] According to a third aspect of an embodiment of the present application, a device is provided, including:
[0014] processor;
[0015] a memory for storing processor-executable instructions;
[0016] The processor implements the method described in the embodiment of the first aspect above by running the executable instructions.
[0017] According to a fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in the embodiments of the first aspect above are implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 This is a network architecture diagram applicable to a method for publishing a middle-end application provided by an exemplary embodiment.
[0019] Figure 2 It is a flowchart of a method for publishing a middle platform application provided by an exemplary embodiment.
[0020] Figure 3 It is a specific flow chart of a method for publishing a middle platform application provided by an exemplary embodiment.
[0021] Figure 4 It is a directory structure diagram of a method for publishing a middle platform application provided by an exemplary embodiment.
[0022] Figure 5 This is a container structure diagram in a method for publishing a middle-end application provided by an exemplary embodiment.
[0023] Figure 6 This is a class loader relationship diagram in a method for publishing a middle platform application provided by an exemplary embodiment.
[0024] Figure 7 It is a structural schematic diagram of a device provided by an exemplary embodiment.
[0025] Figure 8It is a block diagram of a publishing device for a middle platform application provided by an exemplary embodiment. DETAILED DESCRIPTION
[0026] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0027] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0028] The front end includes various interfaces for interacting with users, such as web pages, mobile apps, etc.; it also includes various functions on the server side that respond to user requests in real time, such as product query and order system. The back end is not directly facing users, but a configuration management system for operators, such as product management, logistics management, settlement management, etc. In the traditional front-end-back end architecture, each participant is independent of each other, and the developers of each participant are responsible for the development work of their own participant. However, each participant has the same functions that need to be implemented. The traditional architecture causes each participant to repeat the development work for the same functions, resulting in a waste of development resources. In order to improve development efficiency, it is necessary to integrate an intermediate platform to provide some common resources for each participant. This intermediate platform is called the middle platform system. The middle platform system can be understood as the support system of the front end. It not only has the common resources that each participant needs to use, but also can call the corresponding application in response to the call request of the participant to help the participant to realize various functions.
[0029] There are two types of applications in the middle office system, namely basic applications and middle office applications. The middle office system implements the functions corresponding to each application by calling various types of applications. Specifically, when the middle office system calls an application, it makes the functions corresponding to this application effective by executing the code contained in the development kit deployed at the application. The basic functions implemented by calling the basic applications can be the same functions that all participants need to implement, while the functions implemented by calling the middle office applications are the customized functions corresponding to the participants who request to publish this middle office application. Specifically, the functions implemented by calling the middle office application are implemented by the middle office system executing the code contained in the development kit of this middle office application. Participants who need to implement customized functions can upload the development kit of the middle office application corresponding to this function to the middle office system. The middle office system republishes the middle office application through the publishing process. The successfully published middle office application can be called by the middle office system to implement the corresponding functions.
[0030] The functions involved in the call request processed by the middle office system may include the basic functions of the middle office system and the customized functions of each participant. The middle office system can implement the customized functions of this participant by calling the middle office application, or it can implement the basic functions of the middle office system by calling the basic application.
[0031] Before each participant calls the middle-office application through the middle-office system to implement customized functions, the participant first needs to send a publishing request to the middle-office system, so that the middle-office system can publish the middle-office application through the publishing process. Only the middle-office application that has been successfully published can be called by the middle-office system to implement the above customized functions. On the technical level, it is actually the middle-office system that responds to the call request and implements the customized functions corresponding to the middle-office application by executing the code contained in the development package corresponding to the middle-office application.
[0032] This manual provides a new publishing solution for middle-end applications. Figure 1 A network architecture diagram applicable to a method for publishing a middle-office application provided as an exemplary embodiment. Figure 1 The publishing portal 11 in the release backend 12 is used to support the release process of the middle-office application. After the release backend 12 is built, the middle-office system 13 can execute the release process based on the successfully built release backend 12. When the middle-office system 13 is publishing, the publishing portal 11 can schedule the release process of the middle-office system 13 in real time. With the support of the release backend 12, the middle-office system 13 can carry out the release process of the middle-office application. The target participant 14 submits the development package corresponding to the middle-office application to be released to the middle-office system 13, and the middle-office system 13 can rely on the release backend 12 to release the middle-office application.
[0033] refer to Figure 1 The architecture shown below is combined with Figure 2This article introduces the specific application process of the release solution for the middle platform application. Figure 2 It is a flowchart of a publishing method provided by an exemplary embodiment, which is applied to a middle-office system to which a middle-office application belongs.
[0034] Step 202: In response to a release request for a target sub-application corresponding to a target participant, a development kit of a new version of the target sub-application submitted by the target participant is obtained.
[0035] In this specification, a middle office application is deployed in the middle office system, and the middle office application contains several sub-applications corresponding to each participant, and each participant relies on the sub-application corresponding to itself to implement the corresponding customized function. When a participant needs to publish or update a certain function, it can send a publishing request to the middle office system. In this specification, the participant who sends the publishing request is referred to as the target participant. The middle office system responds to the publishing request initiated by the target participant, obtains the new version of the target sub-application development kit corresponding to the above-mentioned customized function, and the above-mentioned new version of the target sub-application development kit is provided by the target participant to the middle office system, which contains the code required to execute to implement the above-mentioned customized function. Compared with all participants sharing one middle office application, the middle office application in this specification contains independent sub-applications corresponding to each participant, and the publishing request of the participant can be only for the sub-application corresponding to itself, and when the middle office system calls, it can also call a specific sub-application for the participant, saving processing resources for the publishing process and the calling process.
[0036] Step 204: Update the version information of the development kit for the target sub-application in the target operating environment where the middle platform application is located to the new version.
[0037] There are multiple operating environments in the middle-office system, and the release in this specification refers to a certain operating environment (hereinafter referred to as the target operating environment). The development kits of the same sub-application running in different environments can be the same or different. If the target participant wants to publish the target development kit to the target operating environment in the middle-office system, the target operating environment information to be published can be included in the publishing request sent to the middle-office system. The middle-office system can confirm the operating environment to be published by parsing the publishing request, that is, confirm the target operating environment, so as to accurately implement the release for the target operating environment. For the convenience of description, the release introduced in this application below is hot release, which dynamically sends code to fix bugs and release functions without restarting the middle-office system.
[0038] After the release is successful, the above development kit will take effect, and the middle-office system can implement it by calling the target sub-application corresponding to the target participant. In fact, calling the target sub-application to implement the customized function of the target participant is to execute the code in the target sub-application development kit corresponding to the target sub-application. There may be multiple versions of the development kit corresponding to the target sub-application. In order to make the above new version of the target sub-application development kit effective in the target operating environment, the middle-office system can not only confirm the target operating environment in the release process, but also update the version information of the target sub-application development kit in the target operating environment from the old version to the new version, that is, establish a mapping relationship similar to "target operating environment-target sub-application-new version", so that when the middle-office system processes the call request, it can call the above new version of the target sub-application development kit according to the updated version information.
[0039] In one embodiment, the release is for the target operating environment. The middle-office system can record the target environment information and version information corresponding to the new target sub-application to form a release record, and summarize the release records corresponding to each release to form a release baseline in chronological order. The release baseline can be expressed as a software document, which records the version, time and other information of each release. The above-mentioned release baseline can help developers trace previous release information. If necessary, the current middle-office system can be restored to its original state based on the target environment information and version information recorded in the release information.
[0040] In one embodiment, as can be seen from the foregoing, the basic functions implemented by calling the basic application are often the same functions that all participants need to implement. These basic functions are different from the customized functions that all participants need to implement and do not change frequently. Therefore, the frequency of changes in the basic application is often lower than the frequency of changes in the sub-application. In addition, the customized functions implemented by calling the sub-application often depend on the basic functions implemented by calling the basic application. For example, the basic function is to implement the order function, and the customized function may be the function of displaying a prompt component on the order interface. Based on the above-mentioned relationship between the basic application and the sub-application, the middle platform system can use the version information of the basic application development kit and the version information of the target sub-application development kit to form a version tree, and record the version information of the basic application development kit at the root node of the version tree, and record the version information of each sub-application development kit at the child node of the version tree. When the version of the sub-application development kit is increased, the new version information of the sub-application development kit can be added to the corresponding child node without changing the version information of the basic application development kit at the root node. When the middle-office system is expanded, the middle-office system can quickly determine the version information of the basic application and sub-application based on the version information recorded in the version tree, and use the above version information to configure the newly added machine resources to improve the efficiency of expansion.
[0041] Step 206: Create a new target tenant container based on the new version of the development kit, and establish an association relationship between the target sub-application and the new target tenant container, so that the new target tenant container is used to carry the new version of the development kit.
[0042] As mentioned above, the middle platform system calls the target sub-application to implement the customized functions of the target participant, which can be achieved by executing the code in the target sub-application development kit corresponding to the target sub-application. In the middle platform system, the target sub-application development kit is carried by the tenant container. When calling the target sub-application, the middle platform system also needs to confirm the tenant container (hereinafter referred to as the target tenant container) that carries the new version of the target sub-application development kit through the association relationship between the target sub-application and the tenant container, and then execute the code of the target sub-application development kit in the target tenant container. In order to ensure that the middle platform system can successfully confirm the target tenant container that carries the new version of the target sub-application development kit according to the association relationship when calling the target sub-application, as described in step 106, the middle platform system needs to create a new target tenant container to carry the new version of the target sub-application when publishing. Furthermore, the middle office system can modify the association relationship between the target sub-application and the tenant container from "the target sub-application is associated with the old tenant container" to "the target sub-application is associated with the new tenant container". After the association relationship is modified, when the middle office system calls the target sub-application to implement the customized function of the target participant, it can confirm the new tenant container according to the modified association relationship, and then call the new version of the target sub-application development kit carried in the new tenant container. After the above steps 202 to 206, the middle office system can successfully execute the new version development kit corresponding to the target sub-application when processing the call request. In other words, the middle office system completes the release process for the target sub-application.
[0043] In one embodiment, the target tenant container can be mapped from the directory of the target participant, specifically: each participant has its own independent directory, and the middle office system stores the development packages uploaded by each participant in the corresponding directory. The directory of the participant is independent of the directory of the middle office system, and the directories of each participant are also separated from each other. Taking the target participant as an example, the directory of the target participant at least contains the target sub-application development package corresponding to this target participant. When establishing the target tenant container, the middle office system can map the directory corresponding to the target participant to the target tenant container to ensure that the target tenant container contains all the development packages in the corresponding directory of the target participant.
[0044] It can be seen from the above embodiments that each participant has its own independent tenant container to ensure that the development kits provided by each participant are isolated from each other. When the middle platform system calls the target sub-application to process the call request, the development kits corresponding to other sub-applications in other tenant containers will not affect the corresponding process. In order to further ensure the independence of the process of the middle platform system calling the target sub-application, the middle platform system can create a new target class loader and a new target context based on the new version of the target sub-application, and add the new target class loader and the new target context to the new target tenant container, that is, each participant’s corresponding tenant container has an independent class loader and context for its own use, and each class loaders are independent of each other. With a new target class loader and a new target context, the middle platform system can use the new target class loader in the target tenant container to load the class contained in the target sub-application development kit into the memory space when calling the target sub-application for the first time, and create a Class object (class object) for the class in the storage space, so as to facilitate the implementation of the customized function corresponding to the target sub-application.
[0045] Furthermore, the middle-office system can use the new target context to configure the operating environment information of the target sub-application development kit. After the first loading and configuration process is completed, the process of calling the target sub-application can be successfully completed. Moreover, when the target sub-application is called again in the subsequent period, the middle-office system does not need to perform the loading or configuration process again. In the above manner, when processing the call request, the middle-office system can use the independent class loader and context of the target sub-application in the target tenant container to run the target sub-application development kit, without using the class loader and context shared with other sub-applications or other objects, thereby ensuring the independence of the middle-office system's call to the target sub-application process.
[0046] As can be seen from the above, the middle-office system can process call requests, and the call requests involve not only calling sub-applications in the middle-office application, but also calling basic applications in the middle-office system. Similarly, there is a basic class loader corresponding to the basic application in the middle-office system. The functions implemented by the basic class loader are basically similar to those of the class loader corresponding to the sub-application, but the object it loads is the development package executed when the basic application is called. In order to reduce the loading pressure of the class loader corresponding to the sub-application, the basic class loader can be set as the parent class of the class loader corresponding to the sub-application, that is, the class loader corresponding to the sub-application can be a subclass of the basic class loader. Under the constraints of the above-mentioned hierarchical relationship, the basic class loader cannot access the class loader corresponding to the sub-application, while the class loader corresponding to the sub-application can access the basic class loader. Then the class loader corresponding to the sub-application can borrow the loading capacity of the basic class loader to reduce its own loading pressure.
[0047] Considering that when the middle-office system calls the target sub-application, the class loader in the target tenant container needs to load the class contained in the target sub-application development kit into the memory space, where the memory space is part of the machine resources. In addition, when the middle-office system calls the target sub-application, whether in the class loading process or the configuration process, computing resources are required, such as machine resources such as CPU (Central Processing Unit). In order to ensure that the middle-office system has sufficient storage resources, computing resources and other machine resources to support the target sub-application when calling it, machine resources for the target sub-application can be added to the target tenant container. The machine resources in the tenant container corresponding to each sub-application are used by the middle-office system to process the relevant call requests of this sub-application. When allocating machine resources, the middle-office system can allocate a reasonable proportion of all the machine resources owned by the middle-office system to the tenant containers corresponding to each sub-application according to the complexity of each sub-application development kit. For example, the development kit of sub-application A occupies more memory and has more complex code logic. The middle-office system can allocate 10% of the machine resources to the tenant container of sub-application A for its use; the development kit of sub-application B occupies less memory and has simpler code logic. The middle-office system can allocate 5% of the machine resources to the tenant container of sub-application B for its use. The above-mentioned machine resources allocated to the tenant container are isolated from other machine resources of the middle-office system. When the middle-office system calls a sub-application, it is supported by machine resources with independent shares, thus avoiding the occurrence of call failures due to insufficient machine resources. In addition, allocating machine resources according to the actual situation of the sub-application development kit can also ensure that the middle-office system makes full use of its machine resources and improves the rationality of resource allocation.
[0048] In one embodiment, if the target participant makes very little change to the code in the development package during the development process, continuing to establish a new tenant container based on the new version of the target sub-application development package may cause a waste of processing resources. In order to solve the above problem, after obtaining the new version of the target sub-application development package, the middle platform system can compare the target code contained in the new version of the target sub-application development package with the effective code contained in the old version of the target sub-application development package. If only the difference in the method body is involved, the middle platform system does not need to establish a new tenant container to carry the new version of the target sub-application development package, but directly makes this new version of the target sub-application development package effective.
[0049] Compared to the middle platform system, which forms a development package set from the development packages submitted by all participants and packages them into an overall development file, and then publishes the above development file as an overall middle platform application, this specification sets up multiple sub-applications corresponding to different participants in the middle platform application, and creates tenant containers corresponding to each sub-application and each independent of each other, and the tenant container contains independent class loaders, contexts and machine resources. Especially when there are many participants connected to the middle platform system, if there is only one overall middle platform application, then even if only one participant uploads a new development package, the collection of all development packages will change accordingly. At this time, the middle platform system needs to re-package the development packages of all participants to generate a new version of the development file, and then re-publish it for this middle platform application. This process consumes a lot of processing resources and requires a restart operation, resulting in a long publishing process. However, this specification uses the above-mentioned container design method to isolate the machine resources, class loaders, contexts and development packages of each sub-application from each other, reducing the mutual influence of the publishing process and calling process of different sub-applications. Also based on the design of the above tenant container, the publishing process provided by this manual can be performed only for the development package submitted by one participant, without affecting the normal operation of other functions of the middle office system, and without waiting for the response of other participants. This process puts little pressure on the middle office system and can be completed without restarting the middle office system. Since this manual can dynamically upgrade the functions corresponding to the sub-application without affecting the normal operation of the middle office system and without restarting the middle office system, the publishing process implemented by this manual can be called hot publishing, or hot deployment.
[0050] Combine the following Figure 3 , describes in detail the process of implementing the release of the middle platform system 13:
[0051] Step 302: The middle office system 13 receives a publishing request from the target participant 14.
[0052] In this step, when a target participant 14 connected to the middle office system 13 needs to release a new function, the developer of this participant can first perform coding development work and generate a new version of the development package. The development package can be a file package with a file extension of ".jar", which contains multiple java (a computer programming language) files that record the code that needs to be executed to implement this function. In the following, "food-app-1.0.1.jar" represents the development package submitted by this target participant 14. After the development is completed, this participant Food can send a release request to the middle office system 13 to request that the middle office system 13 will release this function through the release process.
[0053] Step 304: The middle platform system 13 obtains the new version of the target sub-application development kit.
[0054] In this step, the middle office system 13 responds to the publishing request sent by the target participant 14 and obtains food-app-1.0.1.jar.
[0055] In fact, the middle platform application in the middle platform system 13 contains several sub-applications corresponding to different participants, and the middle platform system 13 can implement corresponding functions by calling sub-applications. After the release process, the middle platform system 13 can smoothly execute the sub-application development kit submitted by the relevant participants when calling the target sub-application. In other words, the release process is the process of enabling the sub-application development kit to be successfully executed.
[0056] It is worth noting that after the middle platform system 13 obtains food-app-1.0.1.jar, it can be deployed in the directory corresponding to the sub-application. For example, assume that before the release method proposed in this specification, the development kit of the middle platform application and the development kit of the basic application are deployed in the AA / BB directory. In this specification, Figure 4 As shown in the figure, a new AA / CC directory is added, and the AA / CC directory is further divided into container subdirectories corresponding to each participant. food-app-1.0.1.jar is a jar file contained in the subdirectory corresponding to the participant Food.
[0057] Step 306: The middle platform system 13 updates the version information.
[0058] The publishing request initiated by the target participant 14 also includes the environment information that needs to be published. The middle-office system 23 can confirm the operating environment that needs to be published, that is, confirm the target operating environment, by parsing the publishing request. And after obtaining the target sub-application development kit, the version information of the target sub-application development kit running in the target operating environment is changed to the version information corresponding to the new version of the target sub-application. Assuming that the version information of the target sub-application development kit running in the target operating environment is 1.0.0, then after obtaining food-app-1.0.1.jar, the middle-office system 13 can update the version information of the target sub-application development kit running in the target operating environment to 1.0.1, so that after the publishing is completed, the middle-office system 13 can call food-app-1.0.1.jar according to the version information. In the above assumptions, the version information is included in the file name of the jar file. In fact, the target participant 14 can also include the version information in the publishing request. The middle-office system 13 can also obtain and update the version information by parsing the publishing request. This specification does not limit the way the middle-office system obtains version information.
[0059] Step 308: Compare the new version of the target sub-application with the old version of the target sub-application that has been in effect, and compare whether the codes contained therein are only different in the method body part. If so, proceed to step 310b; if there are more than differences in the method body part, proceed to step 310a.
[0060] In fact, it is because in the actual development process, the target participants may make very small changes to the code. If a new tenant container is established based on the new version of the target sub-application as described in step 310, it may cause a waste of processing resources. In order to solve the above problem, in step 310b, after obtaining the new version of the target sub-application, the middle platform system 13 can compare the target code contained in the new version of the target sub-application with the effective code contained in the old version of the target sub-application. If only the difference in the method body is involved, the hot patch in the old tenant container can be used to directly make the target development package effective, eliminating the step of establishing a new tenant container.
[0061] Step 310a: Create a new tenant container.
[0062] In this step, the middle office system 13 creates a new target tenant container based on the new target sub-application. Figure 4 The directory of the target participant 14, namely Food, is mapped to the target tenant container to ensure that the new target tenant container contains food-app-1.0.1.jar.
[0063] Step 312a: The middle office system 13 adds the classloader and context to the new tenant container.
[0064] First, if Figure 5 As shown, the middle-office system 13 can also create a new class loader (classloader) based on food-app-1.0.1.jar and add it to the target tenant container. After the release is completed, when calling this sub-application, the middle-office system 23 can use the compiler to compile the Java file in food-app-1.0.1.jar and convert it into a class file with a file extension of ".class". Then, the middle-office system 13 can use the class loader to read the above class file and convert it into an instance of the java.lang.Class class. Each such instance is used to represent a Java class. Through the method of this instance, an object of the class can be created, which implements the code logic in food-app-1.0.1.jar.
[0065] In addition, when the middle platform system 13 processes a call request, it not only involves calling the sub-applications corresponding to each participant in the middle platform application, but also involves calling the basic application in the middle platform system 13. Similarly, there is also a basic class loader for the basic application in the middle platform system 13. For example Figure 6 As shown, it is assumed that there are class loaders corresponding to the participants Food, Trip, Music, etc. in the middle station system 13, and these class loaders are respectively applied to the sub-applications corresponding to these participants. The basic class loader can be set as the parent class of the class loader corresponding to each participant, that is, the class loader of each sub-application is a subclass of the basic class loader, and the class loaders of each sub-application are independent of each other. Under the constraints of the above-mentioned hierarchical relationship, the class loader of the sub-application can access the basic class loader to realize the call of the sub-application to the basic application; and the basic class loader cannot access the class loader of the sub-application, and the class loaders of each sub-application cannot access each other, thereby realizing the mutual isolation between each sub-application.
[0066] Secondly, if Figure 5 As shown, the middle-office system 13 can also inject a new Spring context into the target container. Specifically, the Spring context is a configuration file that provides context information to the Spring framework and can be used to store some dependencies. When the middle-office system 13 calls this sub-application, in order to correctly inject the objects created by the above class loading process into the required place, the middle-office system 13 needs to understand the configuration specified by the target participant through the Spring context and inject dependencies based on this configuration.
[0067] Finally, if Figure 5 As shown, the tenant container also contains machine resources for independent use by this participant. Specifically, the middle-office system 13 needs to use machine resources such as storage resources and computing resources in the process of class loading and context configuration. The middle-office system 13 can allocate a certain proportion of machine resources to the tenant container of each participant according to the complexity of the sub-application development kit corresponding to each participant, and the machine resources of each participant are isolated from each other.
[0068] It is worth noting that the tenant container also provides a container time listener and a container management interface. For example, the middle station system 13 can define events such as starting (starting) / started (started) / stopping (stopped) / stopped (stopped) / failed (failed), and provide a Listener (listening) interface for listening to the above events. After listening to the above events, the middle station system 23 can manage the tenant container through the corresponding container management interface, such as registering related resources when the tenant container is started, unloading related resources and cleaning up the cache when the tenant container is closed, etc.
[0069] Step 314a: The middle office system 13 modifies the association relationship.
[0070] In step 306, the middle office system 13 has updated the version information of the sub-application development kit running in the target operating environment. At this time, it is also necessary to modify the association between the sub-application and the tenant container, so that when the middle office system 13 calls the sub-application in the future, it can determine the new tenant container based on the association relationship, and then execute the new version of the sub-application development kit. Specifically, the old version of the sub-application development kit is carried by the old tenant container, and the middle office system 13 needs to change the association between the sub-application and the tenant container from being associated with the old tenant container to being associated with the new tenant container. When calling the sub-application, the middle office system 13 can confirm the new tenant container based on the new association relationship, and then execute the one carried in the new tenant container.
[0071] Step 316a: After the association relationship is modified, the middle-office system 13 can successfully execute the code in food-app-1.0.1.jar when calling the sub-application, which means that the newly released function of the target participant 14 takes effect and the release process ends.
[0072] Step 318a: Record the release baseline.
[0073] The above-mentioned release process is for the target environment. The middle-office system 13 can record the environmental information and version information corresponding to the new target sub-application to form a release record, and summarize the release records corresponding to each release to form a release baseline in chronological order. The release baseline can be expressed as a software document, which records the version, time and other information of each release. The above-mentioned release baseline can help developers trace previous release information. If necessary, the current middle-office system can be restored to its original state based on the environmental information and version information recorded in the release information.
[0074] Figure 7 is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 7 At the hardware level, the device includes a processor 702, an internal bus 704, a network interface 706, a memory 708, and a non-volatile memory 710, and may also include other required hardware. One or more embodiments of this specification may be implemented based on software, such as the processor 702 reading the corresponding computer program from the non-volatile memory 710 into the memory 608 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0075] Please refer to Figure 8 The release device of the middle platform application can be used for Figure 7 The device shown in the figure is used to implement the technical solution of this specification. The publishing device may include:
[0076] An acquisition unit 802, in response to a release request for a target sub-application corresponding to a target participant, acquires a development kit of a new version of the target sub-application submitted by the target participant;
[0077] A version updating unit 804 is used to update the version information of the development kit for the target sub-application in the target operating environment where the middle platform application is located from the old version to the new version;
[0078] The container creation unit 806 creates a new target tenant container based on the new version of the development kit, and establishes an association relationship between the target sub-application and the new target tenant container, so that the new target tenant container is used to carry the new version of the development kit.
[0079] Optionally, the creating a new target tenant container based on the new version development kit includes:
[0080] Creating a target class loader and a target context based on the new version of the development kit;
[0081] A new target tenant container is created based on the new version of the development kit, and the target class loader and the target context are added to the new target tenant container.
[0082] Optionally, when the middle platform application depends on the basic application integrated in the middle platform system, the target class loader is a subclass of the basic class loader corresponding to the basic application.
[0083] Optionally, the class loaders in the tenant containers of each sub-application are independent of each other.
[0084] Optionally, each participant has its own independent directory, and the creating a new target tenant container includes: a mapping unit 508 maps a target directory corresponding to the target participant to the new target tenant container.
[0085] Optionally, the publishing device may further include a comparing unit 808:
[0086] Used to compare the target code contained in the new version of the development kit with the validated code contained in the old version of the development kit;
[0087] If the target code is different from the validated code only in the method body, the new version of the development kit is validated using the old tenant container.
[0088] Optionally, the publishing device may further include a recording unit 810:
[0089] Used to record the environment information and version information corresponding to the development kit of the new version; and use the environment information and version information to form a release baseline.
[0090] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.
[0091] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0092] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0093] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0094] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0095] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0096] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0097] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0098] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.
Claims
1. A method for publishing a middle-office application, applied to a middle-office system to which the middle-office application belongs, wherein the middle-office application includes sub-applications corresponding to each participant, and the development kits of the sub-applications are respectively in corresponding tenant containers, and each participant has its own independent directory; the method includes: In response to a release request for a target sub-application corresponding to a target participant, obtaining a development kit of a new version of the target sub-application submitted by the target participant; Updating the version information of the development kit for the target sub-application in the target operating environment where the middle platform application is located to the new version; Creating a new target tenant container based on the new version of the development kit, and establishing an association relationship between the target sub-application and the new target tenant container, so that the new target tenant container is used to carry the new version of the development kit, and the target tenant container is obtained by mapping the target directory corresponding to the target participant; The creating a new target tenant container based on the new version of the development kit includes: Creating a target class loader and a target context based on the new version of the development kit; A new target tenant container is created based on the new version of the development kit, and the target class loader and the target context are added to the new target tenant container.
2. According to the method described in claim 1, when the middle-office application depends on the basic application integrated in the middle-office system, the target class loader is a subclass of the basic class loader corresponding to the basic application.
3. According to the method of claim 1, the class loaders in the tenant containers of each sub-application are independent of each other.
4. The method according to claim 1, further comprising: Comparing the target code contained in the new version of the development kit with the validated code contained in the old version of the development kit; If the target code differs from the validated code only in the method body, the new version of the development kit is validated using the old tenant container.
5. The method according to claim 1, further comprising: Record the environment information and version information corresponding to the new version of the development kit; A release baseline is formed using the environment information and version information.
6. A publishing device for a middle-office application, applied to a middle-office system to which the middle-office application belongs, wherein the middle-office application includes sub-applications corresponding to each participant, and the development kits of the sub-applications are respectively in corresponding tenant containers, and each participant has its own independent directory; the device includes: An acquisition unit, in response to a release request for a target sub-application corresponding to a target participant, acquires a development package of a new version of the target sub-application submitted by the target participant; A version updating unit, used to update the version information of the development kit for the target sub-application in the target operating environment where the middle platform application is located from the old version to the new version; A container creation unit, which creates a new target tenant container based on the new version of the development kit, and establishes an association relationship between the target sub-application and the new target tenant container, so that the new target tenant container is used to carry the new version of the development kit, and the target tenant container is obtained by mapping the target directory corresponding to the target participant; The creating a new target tenant container based on the new version of the development kit includes: Creating a target class loader and a target context based on the new version of the development kit; A new target tenant container is created based on the new version of the development kit, and the target class loader and the target context are added to the new target tenant container.
7. An electronic device comprising: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 5 by running the executable instructions.
8. A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 5.
