CN109683992B - Method and apparatus for managing objects - Google Patents

Method and apparatus for managing objects Download PDF

Info

Publication number
CN109683992B
CN109683992B CN201710971306.5A CN201710971306A CN109683992B CN 109683992 B CN109683992 B CN 109683992B CN 201710971306 A CN201710971306 A CN 201710971306A CN 109683992 B CN109683992 B CN 109683992B
Authority
CN
China
Prior art keywords
target control
control reversal
called
proxy
reversal container
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710971306.5A
Other languages
Chinese (zh)
Other versions
CN109683992A (en
Inventor
杨丽敏
薛韬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201710971306.5A priority Critical patent/CN109683992B/en
Publication of CN109683992A publication Critical patent/CN109683992A/en
Application granted granted Critical
Publication of CN109683992B publication Critical patent/CN109683992B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The embodiment of the application discloses a method and a device for managing objects. One embodiment of the method comprises: during the starting of the target control reversal container, creating an object proxy by instantiating a class of the object proxy, wherein the target control reversal container is used for storing the object proxy and the object, and the object proxy is used for managing the object in the target control reversal container; after the target control reversal container is started, in response to receiving an object calling request, determining whether a called object exists in the target control reversal container through an object proxy; and creating, by the object proxy, the invoked object in response to the invoked object not existing. This embodiment reduces the maintenance cost of the target inversion container.

Description

Method and apparatus for managing objects
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to the technical field of internet, and particularly relates to a method and a device for managing objects.
Background
Spring is a lightweight Java development framework for solving the complexity of enterprise application development. An Inversion of Control (IOC) container provided by Spring separates the creation of Java objects from the use of Java objects in a Dependent Injection (DI) manner, so that applications can realize high modularization and servization, and are widely applied to the development of Web applications.
Typically, declarations of objects injected into a control reversal container rely on static compilation, such as declarations of injected objects by way of a configuration file or Annotation (Annotation).
Disclosure of Invention
The embodiment of the application aims to provide a method and a device for managing objects.
In a first aspect, an embodiment of the present application provides a method for managing an object, where the method includes: during the starting of a target control reversal container, creating an object proxy by instantiating a class of the object proxy, wherein the target control reversal container is used for storing the object proxy and the object, and the object proxy is used for managing the object in the target control reversal container; after the target control reversal container is started, in response to receiving an object invocation request, determining, by the object proxy, whether a called object exists in the target control reversal container, and in response to the called object not existing, creating, by the object proxy, the called object.
In some embodiments, creating the invoked object by the object proxy in response to the invoked object not existing comprises: and in response to the existence of the class file of the called object, calling a class loader of a target control reversal container through the object proxy, loading the class file of the called object, and creating the called object.
In some embodiments, creating the invoked object by the object proxy in response to the invoked object not existing comprises: downloading the class file of the called object in response to the absence of the class file of the called object; and calling a class loader of the target control reversal container through the object proxy, loading the downloaded class file, and creating a called object.
In some embodiments, the method further comprises: the number of invoked objects is increased by the object proxy in response to the invoked objects being present and occupied.
In some embodiments, the method further comprises: after the target control reversal container is started, responding to the received object modification request, analyzing the object modification request to obtain the parameter to be modified and the parameter value to be modified of the object to be modified, and setting the value of the parameter to be modified of the object to be modified as the parameter value to be modified through the object proxy.
In some embodiments, the method further comprises: after the target control reversal container is started, scanning the target control reversal container at a preset time interval through the object agent to obtain an object set in the target control reversal container and calling information of each object, and determining the load of the target control reversal container; and in response to the load of the target control reversal container being greater than the threshold load, destroying the objects that have not been invoked for the longest time by the object proxy based on the set of objects and the invocation information for each object.
In a second aspect, an embodiment of the present application provides an apparatus for managing objects, where the apparatus includes: the initialization unit is configured to start a target control reversal container and create an object proxy by instantiating a class of the object proxy, wherein the target control reversal container is used for storing the object proxy and the object, and the object proxy is used for managing the object in the target control reversal container; and the object creating unit is used for responding to the received object calling request after the target control reversal container is started, determining whether a called object exists in the target control reversal container or not through the object proxy, and responding to the fact that the called object does not exist, and creating the called object through the object proxy.
In some embodiments, the object creation unit comprises: and the first instantiation module is used for calling the class loader of the target control reversal container through the object proxy in response to the existence of the class file of the called object, loading the class file of the called object and creating the called object.
In some embodiments, the object creation unit further comprises: the downloading module is configured to respond to the absence of the class file of the called object and download the class file of the called object; and the second instantiation module is configured for calling a class loader of the target control reversal container through the object proxy, loading the downloaded class file and creating the called object.
In some embodiments, the apparatus further comprises: and the object adding unit is configured to respond to the existence and occupation of the called object and increase the number of the called objects through the object proxy.
In some embodiments, the apparatus further comprises: and the object updating unit is configured to respond to the received object modification request after the target control reversal container is started, analyze the object modification request to acquire the parameter to be modified and the parameter value to be modified of the object to be modified, and set the value of the parameter to be modified of the object to be modified as the parameter value to be modified through the object proxy.
In some embodiments, the apparatus further comprises: the load determining unit is configured to scan the target control reversal container at a preset time interval through the object proxy to acquire an object set in the target control reversal container and calling information of each object after the target control reversal container is started, and determine the load of the target control reversal container; and the object destroying unit is configured to destroy the objects which are not called for the longest time through the object proxy based on the object set and the calling information of each object in response to the fact that the load of the target control reversal container is larger than the threshold load.
In a third aspect, an embodiment of the present application provides a server, including: one or more processors; a storage device to store one or more programs that, when executed by one or more processors, cause the one or more processors to implement a method as in any embodiment of a method for managing objects.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium on which a computer program is stored, which when executed by a processor, implements a method as in any one of the embodiments of the method for managing objects.
According to the method and the device for managing the object, the object proxy is created during the starting of the target control reversal container, and the called object which is not injected into the target control reversal container is created by the object proxy based on the object calling request after the target control reversal container is started, so that the object in the target control reversal container can be dynamically maintained without restarting the target reversal container, and the maintenance cost of the target reversal container is reduced.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for managing objects according to the present application;
FIG. 3 is a schematic illustration of an application scenario of a method for managing objects according to the present application;
FIG. 4 is a schematic block diagram illustrating one embodiment of an apparatus for managing objects according to the present application;
FIG. 5 is a block diagram of a computer system suitable for use in implementing a server according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 illustrates an exemplary system architecture 100 to which the method for managing objects or the apparatus for managing objects of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include a management server 101, a terminal device 103, and a network 102, and the terminal device 103 may include a target control reversal container 1031 for storing a subject agent 10311 and a subject 10312. The object agent 10311 may be an instance of a static declaration during the startup of the target control reversal container 1031 for dynamically managing objects in the target control reversal container. The network 102 serves as a medium for providing a communication link between the management server 101 and the terminal device 103. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user (e.g., an application developer or a maintenance person) can use the terminal device 103 to interact with the management server 101 through the network 102, receive and transmit messages and the like according to a predetermined protocol (e.g., TR069 protocol and the like) to complete various operations on the terminal device 103, such as automatic configuration, diagnosis, upgrade and the like.
The management server 101 may be a server that provides various management services, such as an auto-configuration server that automatically configures the terminal device 103. The automatic configuration server may perform processing such as analysis on data such as the received service request, and automatically configure the terminal device 103 based on the processing result (for example, configuration information of the terminal device 103 corresponding to the user information).
The terminal device 103 may be various terminal electronic devices, including but not limited to a set-top box, a router, a smart phone, a tablet computer, an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III, mpeg Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, mpeg Audio Layer 4), a laptop computer, a desktop computer, and the like. Further, the terminal device 103 may also be an application server, for example, a front-end Web server or the like.
It should be noted that the method for managing objects provided in the embodiment of the present application is generally executed by the terminal device 103, and accordingly, the apparatus for managing objects is generally disposed in the terminal device 103.
It should be understood that the number of terminal devices, networks and management servers in fig. 1 is merely illustrative. There may be any number of management servers, terminal devices, and networks, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for managing objects in accordance with the present application is shown. The method comprises the following steps:
step 201, during the starting of the target control reversal container, creating an object proxy by instantiating a class of the object proxy, wherein the target control reversal container is used for storing the object proxy and the object, and the object proxy is used for managing the object in the target control reversal container.
In this embodiment, an electronic device (e.g., the terminal device 103 shown in fig. 1) on which the method for managing objects operates may start a target control reversal container, and instantiate a class of an object proxy during the start of the target control reversal container to obtain the object proxy, where instantiating the class of the object proxy may be implemented by way of a static declaration such as a configuration file, a comment, or the like.
Here, the target control reversal container may be a container component integrated in the above-described electronic device for storing the object proxy and the object. The object proxy is used to dynamically manage objects in the target control reversal container, e.g., inject objects into the target control reversal container, modify injected objects, delete injected objects from the target control reversal container, etc. In this way, only the object proxies need to be declared during the target control reversal container startup, and not all objects that need to be injected into the target control reversal container.
Step 202, after the target control reversal container is started, in response to receiving an object calling request, determining whether a called object exists in the target control reversal container through an object proxy; and creating, by the object proxy, the invoked object in response to the invoked object not existing.
In this embodiment, after the target control reversal container is started (i.e., during the running of the target control reversal container), the electronic device (e.g., the terminal device 103 shown in fig. 1) may receive an object invocation request from an external device (e.g., the management server 101 shown in fig. 1), parse the object invocation request, obtain an identifier of a called object, then query whether the called object exists in the target control reversal container through the object proxy created in step 210 based on the identifier of the called object, and create the called object by the object proxy when the called object does not exist in the target control reversal container. That is, the electronic device may dynamically inject the called object into the target control reversal container by the object proxy according to the requirement of the object call request, so that the target control reversal container does not need to be frequently restarted, and the target control reversal container does not need to maintain a fixed resource overhead as soon as the target control reversal container is started.
Here, the object call request may be a request for calling a specific object to perform a specific operation, in which an identification of the called object (e.g., a name of the called object) and an operation to be performed by the called object (e.g., a method of the called object) are encapsulated.
In some optional implementations of this embodiment, when a class file of the called object exists in an electronic device (e.g., the terminal device 103 shown in fig. 1) on which the method for managing an object operates, the called object may be directly created by the object proxy. For example, calling the target control by the object proxy reverses the class loader in the container. And loading the class file of the called object, instantiating the class of the called object and obtaining the called object.
In some optional implementations of this embodiment, when the class file of the called object does not exist in the electronic device (for example, the terminal device 103 shown in fig. 1) on which the method for managing the object operates, the class file of the called object may be downloaded first, and then the called object may be created through the object proxy. For example, a class file of a called object is downloaded from a remote server (e.g., the management server 101 shown in fig. 1), then a class loader of a target control reversal container is called by an object proxy, the downloaded class file is loaded, and a class of the called object is instantiated to obtain the called object. It can be seen that, the method for managing objects of the embodiment may not only instantiate the class file of the called object existing in the electronic device, but also obtain the class file of the called object from the outside and instantiate the class file.
In some optional implementations of the embodiment, when the called object is occupied (e.g., called by other call requests), the number of called objects is increased by the object proxy. For example, the object proxy calls a class loader of the target control reversal container, reloads the class file of the called object, instantiates the class of the called object again, and acquires another called object. By increasing the number of called objects, the waiting time of object calling requests can be reduced, and the response speed of the target control reversal container is improved.
In some optional implementations of this embodiment, the method further includes: after the target control reversal container is started, responding to the received object modification request, analyzing the object modification request to obtain the parameter to be modified and the parameter value to be modified of the object to be modified, and setting the value of the parameter to be modified of the object to be modified as the parameter value to be modified through the object proxy.
In some optional implementations of this embodiment, the method further includes: after the target control reversal container is started, scanning the target control reversal container at a preset time interval through an object agent to obtain an object set in the target control reversal container and calling information of each object, and determining whether the load of the target control reversal container is greater than a preset threshold load or not, wherein the calling information of the object can comprise the number of calling times of the object, the latest calling time and the like; and when the load of the target control reversal container exceeds the threshold load, destroying the objects which are not called for the longest time through the object proxy based on the object set and the calling information of each object. Because the objects in the object set can be injected into the target control reversal container based on the object calling request, the time when the objects are not called can be determined according to the current time and the time when the objects are called last time, the objects in the object set are sorted according to the length of the time when the objects are not called, and the objects which are not called for the longest time are deleted in sequence until the load of the target control reversal container is lower than the threshold load, so that the utilization rate of the objects injected into the target control reversal container is optimized, and the load of the target control reversal container is maintained within a reasonable range,
with continuing reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method for managing objects according to the present embodiment. In the application scenario of fig. 3, during the starting of the target control reversal container, the terminal device starts the target control reversal container and creates an object proxy of the target control reversal container, so as to complete the initialization of the target control reversal container; after the target control reversal container is started, the terminal device can receive an object calling request from the automatic configuration server and obtain the identification of a called object, and find whether the called object exists in the target control reversal container or not through the object proxy based on the identification of the called object; when the called object does not exist in the target control reversal container, the called object is created through the object proxy.
According to the method provided by the embodiment of the application, the called object which is not injected into the target control reversal container is created based on the object calling request after the target control reversal container is started through the object proxy, the initialization of the control reversal container is separated from the injection of the object, the object in the target control reversal container can be dynamically maintained under the condition that the target reversal container is not restarted, and therefore the maintenance cost of the target reversal container is reduced.
With further reference to fig. 4, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of an apparatus for managing objects, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable to various electronic devices.
As shown in fig. 4, the apparatus 400 for managing objects of the present embodiment includes: an initialization unit 401 and an object creation unit 402.
The initialization unit 401 is configured to start a target control reversal container for storing an object proxy and an object and create the object proxy by instantiating a class of the object proxy, where the object proxy is used for managing the object in the target control reversal container; the object creating unit 402 is configured to determine, by the object proxy, whether a called object exists in the target control reversal container in response to receiving an object call request after the target control reversal container is started, and create, by the object proxy, the called object in response to the called object not existing.
In some optional implementations of this embodiment, the object creation unit 402 comprises a first instantiation module. The first instantiation module is configured to respond to the existence of the class file of the called object, load the class file of the called object and create the called object by calling the class loader of the target control reversal container through the object proxy.
In some optional implementations of this embodiment, the object creating unit 402 further includes a downloading module and a second instantiation module. The downloading module is configured to respond to the absence of the class file of the called object and download the class file of the called object; the second instantiation module is configured to call a class loader of the target control reversal container through the object proxy, load the downloaded class file, and create a called object.
In some optional implementations of the present embodiment, the apparatus 400 for managing objects of the present embodiment further includes an object adding unit. The object adding unit is configured to increase the number of the called objects through the object proxy when the called objects are occupied.
In some optional implementations of the present embodiment, the apparatus 400 for managing objects of the present embodiment further includes an object updating unit. The object updating unit is configured to, after the target control reversal container is started, respond to a received object modification request, analyze the object modification request to obtain a parameter to be modified and a parameter value to be modified of the object to be modified, and set a value of the parameter to be modified of the object to be modified as the parameter value to be modified by the object broker.
In some optional implementations of the present embodiment, the apparatus 400 for managing objects of the present embodiment further includes a load determination unit and an object destruction unit. The load determining unit is configured to scan the target control reversal container at a predetermined time interval through the object proxy to obtain an object set and calling information of each object in the target control reversal container after the target control reversal container is started, and determine a load of the target control reversal container; the object destroying unit is configured to destroy, by the object agent, the object that has not been called for the longest time based on the object set and the calling information of each object when the load of the target control reversal container is greater than the threshold load.
It should be understood that the units recited in the apparatus 400 correspond to the various steps in the method described with reference to fig. 2. Thus, the operations and features described above for the method are equally applicable to the apparatus 400 and the units included therein, and are not described in detail here.
The apparatus 400 for managing objects according to the embodiment of the present application creates, by using the object proxy, a called object that is not injected into the target control reversal container based on the object call request after the target control reversal container is started, separates the initialization of the control reversal container and the injection of the object, and can dynamically maintain the object in the target control reversal container without restarting the target reversal container, thereby reducing the maintenance cost of the target reversal container.
Referring now to FIG. 5, shown is a block diagram of a computer system 500 suitable for use in implementing a terminal device of an embodiment of the present application. The terminal device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the method of the present application when executed by the Central Processing Unit (CPU) 501. It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an initialization unit and an object creation unit. The names of these units do not in some cases form a limitation on the unit itself, and for example, the initialization unit may also be described as a "unit that initializes the target control reversal container and its object proxy".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: during the starting of a target control reversal container, creating an object proxy by instantiating a class of the object proxy, wherein the target control reversal container is used for storing the object proxy and the object, and the object proxy is used for managing the object in the target control reversal container; after the target control reversal container is started, in response to receiving an object calling request, determining whether a called object exists in the target control reversal container through an object proxy; and creating, by the object proxy, the invoked object in response to the invoked object not existing.
The foregoing description is only exemplary of the preferred embodiments of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (14)

1. A method for managing objects, the method comprising:
creating an object agent by instantiating a class of object agents during startup of a target control reversal container for storing the object agents and objects, the object agent for managing the objects in the target control reversal container, the managing comprising: modifying the object injected into the target control reversal container;
after the target control reversal container is started, in response to receiving an object invocation request, determining, by the object proxy, whether a invoked object exists in the target control reversal container, and in response to the invoked object not existing, creating, by the object proxy, the invoked object.
2. The method of claim 1, wherein the creating the invoked object by the object proxy in response to the invoked object not existing comprises:
and in response to the existence of the class file of the called object, calling a class loader of the target control reversal container through the object proxy, loading the class file of the called object, and creating the called object.
3. The method of claim 1, wherein the creating the invoked object by the object proxy in response to the invoked object not existing comprises:
downloading the class file of the called object in response to the class file of the called object not existing;
and calling a class loader of the target control reversal container through the object proxy, loading the downloaded class file, and creating the called object.
4. The method of claim 1, further comprising:
in response to the called object being present and occupied, increasing, by the object proxy, the number of called objects.
5. The method of claim 1, further comprising:
after the target control reversal container is started, responding to a received object modification request, analyzing the object modification request to obtain a parameter to be modified and a parameter value to be modified of an object to be modified, and setting the value of the parameter to be modified of the object to be modified as the parameter value to be modified through the object agent.
6. The method of claim 1, further comprising:
after the target control reversal container is started, scanning the target control reversal container at a preset time interval through the object agent to obtain an object set in the target control reversal container and calling information of each object, and determining the load of the target control reversal container; and in response to the load of the target control reversal container being greater than a threshold load, destroying, by the object broker, objects that have not been invoked for the longest time based on the set of objects and the invocation information for each object.
7. An apparatus for managing objects, the apparatus comprising:
an initialization unit configured to start a target control reversal container for storing the object proxy and an object and create the object proxy by instantiating a class of the object proxy, wherein the object proxy is configured to manage the object in the target control reversal container, and the management includes: modifying an object injected into the target control reversal container;
and the object creating unit is used for responding to the received object calling request after the target control reversal container is started, determining whether a called object exists in the target control reversal container or not through the object proxy, and responding to the absence of the called object, and creating the called object through the object proxy.
8. The apparatus of claim 7, wherein the object creation unit comprises:
the first instantiation module is used for responding to the existence of the class file of the called object, calling the class loader of the target control reversal container through the object proxy, loading the class file of the called object and creating the called object.
9. The apparatus of claim 7, wherein the object creation unit further comprises:
the downloading module is configured to respond to the absence of the class file of the called object and download the class file of the called object;
and the second instantiation module is configured to call the class loader of the target control reversal container through the object proxy, load the downloaded class file and create the called object.
10. The apparatus of claim 7, further comprising:
an object addition unit configured to add, by the object proxy, the number of the called objects in response to the called objects existing and being occupied.
11. The apparatus of claim 7, further comprising:
and the object updating unit is configured to respond to a received object modification request after the target control reversal container is started, analyze the object modification request to acquire a parameter to be modified and a parameter value to be modified of the object to be modified, and set the value of the parameter to be modified of the object to be modified as the parameter value to be modified through the object agent.
12. The apparatus of claim 7, further comprising:
the load determining unit is configured to scan the target control reversal container at a predetermined time interval through the object proxy to acquire an object set and calling information of each object in the target control reversal container after the target control reversal container is started, and determine the load of the target control reversal container;
and the object destroying unit is configured to destroy the objects which are not called for the longest time through the object proxy based on the object set and the calling information of each object in response to the fact that the load of the target control reversal container is larger than a threshold load.
13. A server, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
14. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN201710971306.5A 2017-10-18 2017-10-18 Method and apparatus for managing objects Active CN109683992B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710971306.5A CN109683992B (en) 2017-10-18 2017-10-18 Method and apparatus for managing objects

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710971306.5A CN109683992B (en) 2017-10-18 2017-10-18 Method and apparatus for managing objects

Publications (2)

Publication Number Publication Date
CN109683992A CN109683992A (en) 2019-04-26
CN109683992B true CN109683992B (en) 2022-06-07

Family

ID=66182922

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710971306.5A Active CN109683992B (en) 2017-10-18 2017-10-18 Method and apparatus for managing objects

Country Status (1)

Country Link
CN (1) CN109683992B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110597493B (en) * 2019-08-22 2023-06-30 深圳市元征科技股份有限公司 Control method of Internet of vehicles development system and related products
CN111522535A (en) * 2020-03-26 2020-08-11 杭州数跑科技有限公司 Data source aggregation method and device, storage medium and computer equipment
CN112667324B (en) * 2020-12-30 2023-12-05 凌云光技术股份有限公司 Method and device for calling command class in command mode

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102591710A (en) * 2010-12-16 2012-07-18 微软公司 Sharing object representations
WO2013049406A1 (en) * 2011-10-01 2013-04-04 Oracle International Corporation Moving an object about a display frame by combining classical mechanics of motion
CN103425532A (en) * 2013-08-27 2013-12-04 北京京东尚科信息技术有限公司 JAVA stateless object management method and device
CN103677975A (en) * 2013-12-09 2014-03-26 北京恒华伟业科技股份有限公司 System and method for having access to internal objects of application systems
CN106940714A (en) * 2017-03-06 2017-07-11 掌阅科技股份有限公司 A kind of data processing method, device and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102591710A (en) * 2010-12-16 2012-07-18 微软公司 Sharing object representations
WO2013049406A1 (en) * 2011-10-01 2013-04-04 Oracle International Corporation Moving an object about a display frame by combining classical mechanics of motion
CN103425532A (en) * 2013-08-27 2013-12-04 北京京东尚科信息技术有限公司 JAVA stateless object management method and device
CN103677975A (en) * 2013-12-09 2014-03-26 北京恒华伟业科技股份有限公司 System and method for having access to internal objects of application systems
CN106940714A (en) * 2017-03-06 2017-07-11 掌阅科技股份有限公司 A kind of data processing method, device and electronic equipment

Also Published As

Publication number Publication date
CN109683992A (en) 2019-04-26

Similar Documents

Publication Publication Date Title
CN108337314B (en) Distributed system, information processing method and device for primary server
CN113377348A (en) Task adjustment method applied to task engine, related device and storage medium
CN111090423B (en) Webhook framework system and method for realizing active calling and event triggering
WO2019015272A1 (en) Information processing method and device
CN109683992B (en) Method and apparatus for managing objects
CN109766148B (en) Method and apparatus for processing interface method calls
CN111427701A (en) Workflow engine system and business processing method
CN113760324A (en) Method and device for constructing micro front-end application
CN107347093B (en) Configuration method and device for distributed server system
CN110457132B (en) Method and device for creating functional object and terminal equipment
CN114564280A (en) Method and system for realizing software package by dynamically loading interface during running
CN109725887B (en) Data interaction method and device based on message research and development framework and terminal equipment
CN113191889A (en) Wind control configuration method, configuration system, electronic device and readable storage medium
CN110795135A (en) Method and device for realizing injection-resolution configuration
CN112083945A (en) NPM installation package update prompting method and device, electronic equipment and storage medium
CN111124523A (en) Method and apparatus for initializing applications
CN113760487B (en) Service processing method and device
CN111142972B (en) Method, apparatus, system, and medium for extending functions of application program
CN115373869A (en) Process processing method and device based on AAR and electronic equipment
CN109669679B (en) Service detection and processing method and device and electronic equipment
CN112395194A (en) Method and device for accessing test platform
CN112311843A (en) Data loading method and device
CN116382796B (en) Plug-in management method and device of H5 applet runner and electronic equipment
CN110851150B (en) Method and apparatus for installing applications
CN118394611B (en) Out-of-band installation operating system progress identification method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TG01 Patent term adjustment
TG01 Patent term adjustment