A storage method and calling method of an application program, a device and a storage medium
By storing multiple Java applications in a single program storage area and running them together, the problem of excessive memory consumption and operational overhead in Java applications is solved, achieving efficient utilization of memory and ports.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING PACTERA JINXIN TECH LTD
- Filing Date
- 2021-12-13
- Publication Date
- 2026-04-28
AI Technical Summary
The current way Java applications are packaged and run results in increased memory consumption, high operational costs, and excessive port usage.
Multiple Java applications can be stored in a single application storage area and run together, providing services through a single port, reducing memory and port usage and optimizing operational overhead.
By sharing storage areas and ports, memory resource consumption is reduced, and the difficulty and cost of operation and maintenance monitoring are lowered.
Smart Images

Figure CN114296774B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method for storing, calling, apparatus for, and storage medium of an application program. Background Technology
[0002] Java is an object-oriented programming language. As a representative of statically typed object-oriented programming languages, Java implements object-oriented theory very well, allowing programmers to perform complex programming in an elegant way.
[0003] However, the current method of packaging and running Java programs involves packaging a Java application into a single, independently running package. This packaging method typically has the following drawbacks: First, when running multiple Java applications, each application's corresponding independently running package consumes memory, increasing memory resource usage; second, the operation and maintenance monitoring system needs to monitor and maintain each independently running package, increasing operational overhead; and third, each Java application must use a separate port, increasing port consumption. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a method for storing, calling, apparatus and storage medium for applications, which adopts the method of storing multiple applications in a program storage area and running them together, so that multiple applications in the program storage area run and provide services through a port, thereby reducing memory resources and port usage and saving operation and maintenance costs.
[0005] This application provides a method for storing an application, the method comprising:
[0006] Select multiple applications from the applications to be stored that have the same configuration information;
[0007] Using the program development tools used to develop the multiple applications, create a program storage area that has the same language environment as the multiple applications;
[0008] Determine the total storage space required by the multiple applications based on the storage space required by each application;
[0009] Based on the total storage space and the available storage space corresponding to the program storage area, the target application is determined from the plurality of applications;
[0010] Based on the storage space required by the target application, the target application is stored in the storage location corresponding to the storage space in the program storage area.
[0011] Optionally, the configuration information includes the development environment, runtime environment, and file format; selecting multiple applications from applications with the same configuration information to be stored includes one of the following methods:
[0012] Select from the applications to be stored the multiple applications that have the same development environment, runtime environment, or file format;
[0013] Select from the applications to be stored the plurality of applications that have the same development environment and the same runtime environment;
[0014] Select from the applications to be stored, the plurality of applications that have the same development environment and file format;
[0015] Select from the applications to be stored the multiple applications that have the same runtime environment and file format;
[0016] Select from the applications to be stored a plurality of applications that have the same development environment, runtime environment and file format.
[0017] Optionally, determining the target application from the plurality of applications based on the total storage space and the available storage space corresponding to the program storage area includes:
[0018] When the total storage space is less than the available storage space, the plurality of applications are used as the target application;
[0019] When the total storage space is greater than the available storage space, at least one intermediate application is selected from the plurality of applications. When the sum of the storage space occupied by the at least one intermediate application is less than the available storage space, the at least one intermediate application is selected as the target application.
[0020] Optionally, selecting at least one intermediate application from the plurality of applications includes:
[0021] Each application is sorted according to its execution order, and the applications within the sorted range are designated as intermediate applications.
[0022] This application also provides a method for invoking an application, the method further comprising:
[0023] The received instruction to invoke the application is parsed to obtain the storage address of the application to be invoked and the identification information of the application to be invoked.
[0024] Based on the storage address, determine the target program storage area where the application to be invoked is located;
[0025] Based on the identification information, locate the application to be invoked from the target program storage area;
[0026] The application to be invoked is called through the target port corresponding to the target program storage area.
[0027] Optionally, the step of invoking the application to be invoked through the target port corresponding to the target program storage area includes:
[0028] When the port corresponding to the target program storage area is idle, that port will be used as the target port; or,
[0029] When the port corresponding to the target program storage area is busy, select the port whose operating environment matches the development environment of the target program storage area from other idle ports as the target port.
[0030] This application embodiment also provides an application storage device, the storage device comprising:
[0031] The selection module is used to select multiple applications from the applications to be stored that have the same configuration information;
[0032] A module is created to use the program development tools used to develop the multiple applications to create a program storage area with the same language environment as the multiple applications;
[0033] The first determining module is used to determine the total storage space required by the plurality of applications based on the storage space required by each application.
[0034] The second determining module is used to determine the target application from the plurality of applications based on the total storage space and the available storage space corresponding to the program storage area;
[0035] The storage module is used to store the target application in the storage location corresponding to the storage space in the program storage area, according to the storage space required by the target application.
[0036] Optionally, the configuration information includes the development environment, runtime environment, and file format; when the selection module selects multiple applications from applications with the same configuration information to be stored, it includes one of the following methods:
[0037] Select from the applications to be stored the multiple applications that have the same development environment, runtime environment, or file format;
[0038] Select from the applications to be stored the plurality of applications that have the same development environment and the same runtime environment;
[0039] Select from the applications to be stored, the plurality of applications that have the same development environment and file format;
[0040] Select from the applications to be stored the multiple applications that have the same runtime environment and file format;
[0041] Select from the applications to be stored a plurality of applications that have the same development environment, runtime environment and file format.
[0042] Optionally, when the second determining module determines the target application from the plurality of applications based on the total storage space and the available storage space corresponding to the program storage area, the second determining module is configured to:
[0043] When the total storage space is less than the available storage space, the plurality of applications are used as the target application;
[0044] When the total storage space is greater than the available storage space, at least one intermediate application is selected from the plurality of applications. When the sum of the storage space occupied by the at least one intermediate application is less than the available storage space, the at least one intermediate application is selected as the target application.
[0045] Optionally, when the second determining module is used to select at least one intermediate application from the plurality of applications, the second determining module is used to:
[0046] Each application is sorted according to its execution order, and the applications within the sorted range are designated as intermediate applications.
[0047] This application also provides an application invocation device, the invocation device comprising:
[0048] The parsing module is used to parse the received instruction to call the application and obtain the storage address of the application to be called and the identification information of the application to be called.
[0049] The third determining module is used to determine the target program storage area where the application to be called is located based on the storage address;
[0050] The search module is used to locate the application to be invoked from the target program storage area based on the identification information;
[0051] The calling module is used to call the application to be called through the target port corresponding to the target program storage area.
[0052] Optionally, when the calling module is used to call the application to be called through a target port corresponding to the target program storage area, the calling module is used to:
[0053] When the port corresponding to the target program storage area is idle, that port will be used as the target port; or,
[0054] When the port corresponding to the target program storage area is busy, select the port whose operating environment matches the development environment of the target program storage area from other idle ports as the target port.
[0055] This application also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the method described above are performed.
[0056] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the method described above.
[0057] This application provides an application storage method, invocation method, apparatus, and storage medium. The method involves selecting multiple applications from a list of applications with identical configuration information; using a program development tool for developing the multiple applications, creating a program storage area with the same language environment as the multiple applications; determining the total storage space required by the multiple applications based on the storage space required by each application; determining a target application from the multiple applications based on the total storage space and the available storage space corresponding to the program storage area; and storing the target application in the storage location corresponding to the storage space required by the target application within the program storage area.
[0058] In this way, by storing multiple applications in a program storage area and running them together, this application enables multiple applications in the program storage area to run and provide services through a single port, thereby reducing memory resources and port usage and saving on operation and maintenance costs.
[0059] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0060] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0061] Figure 1 A flowchart illustrating an application storage method provided in an embodiment of this application;
[0062] Figure 2 A flowchart illustrating an application invocation method provided in this application embodiment;
[0063] Figure 3 A schematic diagram of the structure of a storage device for an application provided in an embodiment of this application;
[0064] Figure 4 A schematic diagram of the structure of an application invocation device provided in an embodiment of this application;
[0065] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0066] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.
[0067] Currently, when programming in Java, Java programs are packaged and run as a single, independently executable package. This packaging method typically has the following drawbacks: First, when running multiple Java applications, each independently executable package consumes memory, increasing memory resource usage. Second, the operation and maintenance monitoring system needs to monitor and maintain each independently executable package, increasing operational overhead. Third, each Java application must use a separate port, increasing port consumption.
[0068] Based on this, embodiments of this application provide a method for storing applications to reduce memory resource and port usage and save on operation and maintenance costs.
[0069] Please see Figure 1 , Figure 1 This is a flowchart illustrating an application storage method provided in an embodiment of this application. Figure 1 As shown in the embodiments of this application, the method for storing an application includes:
[0070] S101. Select multiple applications from the applications to be stored that have the same configuration information.
[0071] In one possible implementation, the configuration information includes a development environment, a runtime environment, and a file format; selecting multiple applications from applications to be stored that have the same configuration information includes one of the following methods: selecting multiple applications from the applications to be stored that have the same development environment, runtime environment, or file format; selecting multiple applications from the applications to be stored that have the same development environment and runtime environment; selecting multiple applications from the applications to be stored that have the same development environment and file format; selecting multiple applications from the applications to be stored that have the same runtime environment and file format; or selecting multiple applications from the applications to be stored that have the same development environment, runtime environment, and file format.
[0072] Here, the development environment refers to a Software Development Environment (SDE), which is a set of software used to support the engineering development and maintenance of system software and application software, based on basic hardware and digital software. The runtime environment refers to the software runtime environment; in a narrow sense, it refers to the hardware support required for software to run; in a broader sense, it can also refer to the various conditions required for software to run, including both the software and hardware environments. The file format refers to the special encoding method used by a computer to store information; it is used to identify internally stored data.
[0073] Here, the selected multiple applications are at least two applications, and the application to be stored can be a package or body of the application to be stored. The selected multiple applications can also be a package or body of the application.
[0074] In another possible implementation, before selecting multiple applications, the storage method further includes: receiving a program storage instruction, the storage instruction being an instruction for determining multiple applications to be stored together, the storage instruction including application configuration information. Specifically, the storage instruction can be sent by a program developer, who can input a programming language representing the storage of multiple applications into a storage area using a program development tool. Based on this programming language, an execution terminal receives the storage instruction sent by the program developer, thereby determining the multiple applications to be stored from the multiple applications to be stored according to the instructions. The execution terminal is a device capable of installing program development tools and capable of program writing and execution.
[0075] For example, when using a Java development tool, the following can be added as a storage instruction to the Java development tool, thereby identifying multiple applications from the application to be stored based on the storage instruction.
[0076]
[0077]
[0078] Here, in the Java development tool's programming interface, enter "dependencey" along with the application name or package name to be stored. The word "dependencey" tells the development tool which application to select, allowing you to choose multiple applications.
[0079] In addition, the same configuration information may also contain the same annotations, which are special markers in the code. These markers can be read during compilation, class loading, and runtime, and corresponding processing can be performed. For example, the annotation can be @component.
[0080] In another possible implementation, the application is created by the following steps: in response to a developer's operation of creating an application on a program development tool based on business needs, the created application is packaged and stored to generate a candidate program; in response to a received program execution instruction, the candidate program is run; and when the candidate program runs successfully, the candidate program is determined as an application that can be selected.
[0081] Here, the selectable application is a program that has been written, can run successfully, and performs preset functions.
[0082] S102. Using the program development tools used to develop the multiple applications, create a program storage area with the same language environment as the multiple applications.
[0083] Here, the created program storage area can be a program package. The creation process of the program storage area includes: creating a program storage area according to the creation process specified by the program development tool; and, in response to the user's operation according to the requirements of the creation process, creating the program storage area with the same language environment as the multiple applications. The user can be a program developer, an operations and maintenance personnel, or other staff.
[0084] Here, the program storage area will be used to store multiple selected applications; the program development tool is a tool for program developers to write programs and generate applications, i.e., the program storage area. Specifically, when the programming language used is Java, the program development tool may include Eclipse (Java Integrated Development Environment) and IntelliJ IDEA (Java Integrated Development Environment), etc. When the programming language used is C, the program development tool may include Visual Studio Code, etc.
[0085] The created program storage area can be a program storage area containing only basic information files, without any application programs. These basic information files include startup class files and configuration files. The basic information files for the program storage area can be automatically added when the program storage area is created using the program development tool. The configuration file can record predetermined port information corresponding to the program storage area.
[0086] For example, you can add a configuration file to the application store area and add predefined port information to that configuration file by adding the following to the application development tool. For instance, use the application development tool to add a "resources" folder to the application store area. Then, use the application development tool to add a configuration file named "[application.properties]" to the "resources" folder. In the "[application.properties]" configuration file, enter "server.port=8082" to add the predefined port information. 8082 is the port number pre-assigned to the application store area.
[0087] S103. Determine the total storage space required by the multiple applications based on the storage space required by each application.
[0088] Here, after selecting multiple applications, the storage space required by each application is identified. After identification, the storage space required by each application is added together to determine the total storage space required by the multiple applications.
[0089] S104. Based on the total storage space and the available storage space corresponding to the program storage area, determine the target application from the plurality of applications.
[0090] Here, the available storage space corresponding to the program storage area can be determined through pre-setting. Alternatively, the remaining storage space on the disk or other storage medium where the program storage area is located can be determined as the available storage space corresponding to the program storage area.
[0091] In one possible implementation, determining the target application from the plurality of applications based on the total storage space and the available storage space corresponding to the program storage area includes: when the total storage space is less than the available storage space, selecting the plurality of applications as the target application; when the total storage space is greater than the available storage space, selecting at least one intermediate application from the plurality of applications, and when the sum of the storage space occupied by the at least one intermediate application is less than the available storage space, selecting the at least one intermediate application as the target application.
[0092] In another possible implementation, selecting at least one intermediate application from the plurality of applications includes: sorting each application according to the execution order of the plurality of applications, and selecting the applications within the sorted range as intermediate applications.
[0093] Here, the execution order can be the priority of the applications, which can be determined by pre-setting by staff or by setting based on usage frequency (running frequency). Specifically, when determining application priority based on usage frequency (running frequency), the priority of each application can be determined in descending order of usage frequency.
[0094] Here, the sorting range can be determined by pre-setting or dynamically by the correspondence between the total storage space required by multiple applications and the available storage space.
[0095] For example, assuming the sorting range is determined by a pre-set method, say a range of zero to three, the step of selecting at least one intermediate application from the plurality of applications is as follows: when the number of the plurality of applications is greater than 3, the first 3 applications in the execution order are determined as intermediate programs; when the number of the plurality of applications is not greater than 3, all the plurality of applications are determined as intermediate programs. In this case, the total storage space required by the intermediate programs is greater than the available storage space, so the first 2 applications in the execution order are determined as intermediate programs.
[0096] Here, after determining the sorting range and intermediate programs based on the sorting range through a pre-set method, it is also necessary to determine whether the total storage space required by the intermediate programs exceeds the available storage space. If it does, intermediate programs with lower execution order are deleted sequentially in ascending order of execution order until the total storage space required by at least one remaining intermediate program does not exceed the available storage space. The remaining intermediate program is then identified as the target application. It is important to note that, due to practical work requirements, the created program storage area must be able to store at least one application.
[0097] Suppose that when determining the sorting range by the correspondence between the total storage space required by multiple applications and the available storage space, the storage space required by the applications that are executed first can be added together to determine multiple total storage spaces. The largest storage space (which is less than the available storage space) is selected from the multiple total storage spaces as the target storage space. It is determined that the target storage space is obtained by adding the storage space required by several applications, and then this number is determined as the sorting range.
[0098] S105. Based on the storage space required by the target application, store the target application in the storage location corresponding to the storage space in the program storage area.
[0099] Here, the storage location can be a folder in the program storage area that stores the application, or it can be a pre-defined sub-storage area.
[0100] In one possible implementation, after storing the target application in the storage location corresponding to the storage space in the program storage area, the storage method further includes: in response to a received program addition instruction, obtaining at least one application to be added, and storing the at least one application to be added in the storage location corresponding to the program storage area.
[0101] Here, the received program addition instruction can be sent by the program developer. Specifically, the program developer can use the program development tool to input a programming language representing adding at least one new application to the program storage area that has already undergone at least one integration operation, and based on the programming language, execute the terminal to receive the program addition instruction.
[0102] Then, upon receiving an application addition instruction, since the instruction includes at least one application specified by the user that needs to be added, the system searches for and retrieves the at least one application specified in the instruction from the device storing the applications to be added.
[0103] Finally, after finding and obtaining at least one application based on the program addition instruction, the obtained at least one new application is stored in the program storage area that already contains multiple applications. After storage is completed and the addition operation is completed, a target program storage area containing at least three applications is obtained.
[0104] Please see Figure 2 , Figure 2 This is a flowchart illustrating an application invocation method provided in an embodiment of this application. Figure 2 As shown in the embodiments of this application, the method for invoking the application includes:
[0105] S201. The received instruction to call the application is parsed to obtain the storage address of the application to be called and the identification information of the application to be called.
[0106] Here, the storage address of the application to be called is the storage address or storage path corresponding to the program storage area; the identification information of the application to be called includes the program package or program name to be called, etc.
[0107] S202. Determine the target program storage area where the application to be called is located based on the storage address.
[0108] Here, the storage address of the application to be invoked, as indicated in the parsing result of the instruction to invoke the application, is determined as the target program storage area where the application to be invoked is located.
[0109] S203. Based on the identification information, locate the application to be invoked from the target program storage area.
[0110] Here, the component scanning of the startup class in the target program storage area can be used to scan the target program storage area. When an application with the identification information is found, the application to be invoked is located.
[0111] The component scan added to the startup class can be added at the beginning of the creation of the target program storage area, or it can be added after the target program storage area is stored to multiple applications and before the application to be called is launched.
[0112] For example, when the target application storage area is created using Eclipse (Java Integrated Development Environment), the component scan added to the startup class in the target application storage area can be `@ComponentScan(basePackages={"com.test.*"})`, used to scan and find applications stored in the target application storage area, locate the application to be called, and then launch the application. For example, the following can be entered in the application development tool to complete the addition of the component scan:
[0113] @SpringBootApplication
[0114] @ComponentScan(basePackages="{"com.test.*"})
[0115] S204. Call the application to be called through the target port corresponding to the target program storage area.
[0116] In one possible implementation, the step of calling the application to be called through the target port corresponding to the target program storage area includes: when the port corresponding to the target program storage area is idle, using the port as the target port; or when the port corresponding to the target program storage area is busy, selecting from other idle ports a port whose runtime environment matches the development environment of the target program storage area as the target port.
[0117] Here, the target port corresponding to the target program storage area can be dynamically configured to ensure that there is a usable free port when the application to be called runs or provides external services.
[0118] Here, idle ports can be determined as follows: based on information such as the application type of the application to be invoked and / or the type of services provided and / or the communication protocol used and / or the programming language used, determine all port information that the application can use, and from all port information, determine at least one idle port that can be used. The determined ports may include various types of ports such as 4-series ports and 8-series ports.
[0119] In this way, after identifying the available port, any port whose operating environment matches the development environment of the target program storage area can be selected as the target port.
[0120] For example, the application to be invoked, as indicated by the program invocation instruction in the target program storage area, can be invoked in the following way: Enter http: / / localhost:8082 / ProjectA and http: / / localhost:8082 / ProjectB in the browser. Here, "http: / / localhost" is the storage address corresponding to the target program storage area, "8082" is the target port that the running program included in the target program storage area will pass through in the predetermined running environment when it starts, and "ProjectA or ProjectB" is the identification information of the application to be invoked, as indicated by the program invocation instruction.
[0121] In addition, if the application to be invoked as indicated by the program invocation command is not found, a call failure message can be sent to the user so that the user can re-enter the program invocation command.
[0122] Therefore, the calling method in this application can be to call the program through the storage address of the target program storage area + the calling port corresponding to the target program storage area + the program name of the application to be called.
[0123] It should be noted that the existing program invocation method involves calling the application by specifying its storage address, the corresponding port number, and its name. However, this method has the following technical problems: each independently running package consumes memory, resulting in high memory usage; each application requires a separate port, leading to port congestion; and the operation and maintenance monitoring system needs to monitor and maintain each running package, resulting in high operational costs. This application, however, implements a method of storing and running multiple packages together. After packaging into a single package, it only occupies the memory of one package, saving resources; multiple applications can share a single port number, eliminating port congestion; and after deployment using a single package, only one package needs to be operated, reducing the difficulty of operation and maintenance monitoring.
[0124] This application provides a method for storing applications. Multiple applications with identical configuration information are selected from those to be stored. A program development tool for developing the multiple applications is used to create a program storage area with the same language environment as the multiple applications. The total storage space required by the multiple applications is determined based on the storage space required by each application. A target application is determined from the multiple applications based on the total storage space and the available storage space corresponding to the program storage area. The target application is stored in the storage location corresponding to the storage space required by the target application within the program storage area.
[0125] In this way, by storing multiple applications in a program storage area and running them together, this application enables multiple applications in the program storage area to run and provide services through a single port, thereby reducing memory resources and port usage and saving on operation and maintenance costs.
[0126] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of a storage device for an application provided in an embodiment of this application. Figure 3 As shown, the storage device 300 includes:
[0127] Selection module 310 is used to select multiple applications from applications to be stored that have the same configuration information;
[0128] Module 320 is created to create a program storage area with the same language environment as the multiple applications using program development tools for developing the multiple applications;
[0129] The first determining module 330 is used to determine the total storage space required by the plurality of applications based on the storage space required by each application.
[0130] The second determining module 340 is used to determine the target application from the plurality of applications based on the total storage space and the available storage space corresponding to the program storage area;
[0131] The storage module 350 is used to store the target application in the storage location corresponding to the storage space in the program storage area, according to the storage space required by the target application.
[0132] Optionally, the configuration information includes the development environment, runtime environment, and file format; when the selection module 310 selects multiple applications from applications with the same configuration information to be stored, it includes one of the following methods:
[0133] Select from the applications to be stored the multiple applications that have the same development environment, runtime environment, or file format;
[0134] Select from the applications to be stored the plurality of applications that have the same development environment and the same runtime environment;
[0135] Select from the applications to be stored, the plurality of applications that have the same development environment and file format;
[0136] Select from the applications to be stored the multiple applications that have the same runtime environment and file format;
[0137] Select from the applications to be stored a plurality of applications that have the same development environment, runtime environment and file format.
[0138] Optionally, when the second determining module 340 determines the target application from the plurality of applications based on the total storage space and the available storage space corresponding to the program storage area, the second determining module 340 is used to:
[0139] When the total storage space is less than the available storage space, the plurality of applications are used as the target application;
[0140] When the total storage space is greater than the available storage space, at least one intermediate application is selected from the plurality of applications. When the sum of the storage space occupied by the at least one intermediate application is less than the available storage space, the at least one intermediate application is selected as the target application.
[0141] Optionally, when selecting at least one intermediate application from the plurality of applications, the second determining module 340 is configured to:
[0142] Each application is sorted according to its execution order, and the applications within the sorted range are designated as intermediate applications.
[0143] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of an application invocation device provided in an embodiment of this application. Figure 4 As shown, the calling device 400 includes:
[0144] The parsing module 410 is used to parse the received instruction to call the application and obtain the storage address of the application to be called and the identification information of the application to be called.
[0145] The third determining module 420 is used to determine the target program storage area where the application to be called is located based on the storage address;
[0146] The lookup module 430 is used to locate the application to be invoked from the target program storage area based on the identification information;
[0147] The calling module 440 is used to call the application to be called through the target port corresponding to the target program storage area.
[0148] Optionally, when the calling module 440 calls the application to be called through a target port corresponding to the target program storage area, the calling module 440 is used to:
[0149] When the port corresponding to the target program storage area is idle, that port will be used as the target port; or,
[0150] When the port corresponding to the target program storage area is busy, select the port whose operating environment matches the development environment of the target program storage area from other idle ports as the target port.
[0151] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5 As shown, the electronic device 500 includes a processor 510, a memory 520, and a bus 530.
[0152] The memory 520 stores machine-readable instructions executable by the processor 510. When the electronic device 500 is running, the processor 510 and the memory 520 communicate via the bus 530. When the machine-readable instructions are executed by the processor 510, they can perform the operations described above. Figures 1-2 The steps of the method in the illustrated method embodiment can be found in the method embodiment for specific implementation methods, which will not be repeated here.
[0153] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figures 1 to 2 The steps of the method in the illustrated method embodiment can be found in the method embodiment for specific implementation methods, which will not be repeated here.
[0154] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0155] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0156] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0157] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0158] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0159] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for storing and retrieving an application, characterized in that, The storage and retrieval methods include: From the applications to be stored that have the same configuration information, select multiple applications that have been written and can run successfully and perform preset functions; specifically, this includes selecting multiple applications from the applications to be stored that have the same development environment, and / or runtime environment and / or file format; wherein, the applications are programs generated using the programming language Java or C. Using the program development tools used to develop the multiple applications, a program storage area with the same language environment as the multiple applications is created; the program storage area is a program storage area that does not contain applications but only contains basic information files, the basic information files including startup class files and configuration files; the configuration file records the predetermined port information corresponding to the program storage area; the startup class file includes a component scan of the startup class; Determine the total storage space required by the multiple applications based on the storage space required by each application; Based on the total storage space and the available storage space corresponding to the program storage area, a target application including at least one application is determined from the plurality of applications; Based on the storage space required by the target application, the target application is stored in the storage location corresponding to the storage space in the program storage area; The storage and retrieval method further includes: in response to a received program addition instruction, obtaining at least one application to be added, and storing the at least one application to be added in a storage location corresponding to the program storage area; wherein, multiple applications stored in the same program storage area run and provide services through a target port corresponding to the program storage area, and the target port corresponding to the target program storage area is dynamically configured; The received instruction to invoke the application is parsed to obtain the storage address of the application to be invoked and the identification information of the application to be invoked. Based on the storage address, the target program storage area where the application to be invoked is located is determined; wherein, the same program storage area stores at least one application that has been written and can run successfully and perform preset functions with the same configuration information, and the configuration information includes at least one of the following: development environment, runtime environment and file format; Based on the identification information, the application to be invoked is located in the target application storage area by scanning the components of the startup class in the target application storage area. The application to be invoked is called through the target port corresponding to the target program storage area.
2. The storage and retrieval method according to claim 1, characterized in that, The configuration information includes the development environment, runtime environment, and file format; selecting multiple applications from applications with the same configuration information to be stored can be done in one of the following ways: Select from the applications to be stored the multiple applications that have the same development environment, runtime environment, or file format; Select from the applications to be stored the plurality of applications that have the same development environment and the same runtime environment; Select from the applications to be stored, the plurality of applications that have the same development environment and file format; Select from the applications to be stored the multiple applications that have the same runtime environment and file format; Select from the applications to be stored a plurality of applications that have the same development environment, runtime environment and file format.
3. The storage and retrieval method according to claim 1, characterized in that, The step of determining the target application from the plurality of applications based on the total storage space and the available storage space corresponding to the program storage area includes: When the total storage space is less than the available storage space, the plurality of applications are used as the target application; When the total storage space is greater than the available storage space, at least one intermediate application is selected from the plurality of applications. When the sum of the storage space occupied by the at least one intermediate application is less than the available storage space, the at least one intermediate application is selected as the target application.
4. The storage and retrieval method according to claim 3, characterized in that, The step of selecting at least one intermediate application from the plurality of applications includes: Each application is sorted according to its execution order, and the applications within the sorted range are designated as intermediate applications.
5. The storage and retrieval method according to claim 1, characterized in that, The step of calling the application to be called through the target port corresponding to the target program storage area includes: When the port corresponding to the target program storage area is idle, that port will be used as the target port; or, When the port corresponding to the target program storage area is busy, select the port whose operating environment matches the development environment of the target program storage area from other idle ports as the target port.
6. A device for storing and retrieving applications, characterized in that, The storage and retrieval device includes: The selection module is used to select multiple completed applications that can run successfully and perform preset functions from applications to be stored that have the same configuration information; specifically, it includes selecting multiple applications from applications to be stored that have the same development environment, and / or runtime environment and / or file format; wherein, the applications are programs generated using Java or C programming languages; A creation module is used to create a program storage area with the same language environment as the multiple applications using program development tools for developing the multiple applications; the program storage area is a program storage area that does not contain applications but only contains basic information files, the basic information files including startup class files and configuration files; the configuration file records the predetermined port information corresponding to the program storage area; the startup class file includes a component scan of the startup class; The first determining module is used to determine the total storage space required by the plurality of applications based on the storage space required by each application. The second determining module is used to determine, from the plurality of applications, a target application including at least one application, based on the total storage space and the available storage space corresponding to the program storage area; The storage module is used to store the target application in the storage location corresponding to the storage space in the program storage area, according to the storage space required by the target application. The parsing module is used to parse the received instruction to call the application and obtain the storage address of the application to be called and the identification information of the application to be called. The third determining module is used to determine the target program storage area where the application to be called is located based on the storage address; wherein, the same program storage area stores at least one application that has been written and can run successfully and perform preset functions with the same configuration information, and the configuration information includes at least one of the following: development environment, runtime environment and file format; The lookup module is used to locate the application to be invoked from the target application storage area by scanning the components of the startup class in the target application storage area based on the identification information. The calling module is used to call the application to be called through a target port corresponding to the target program storage area; The storage and retrieval device is further configured to, in response to a received program addition instruction, acquire at least one application to be added, and store the at least one application to be added in a storage location corresponding to the program storage area; wherein, multiple applications stored in the same program storage area run and provide services through a target port corresponding to the program storage area, and the target port corresponding to the target program storage area is dynamically configured.
7. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the machine-readable instructions are executed by the processor to perform the steps of the store and invoke method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, performs the steps of the store and invoke method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
File storage method, device and system
CN111694521A