[go: up one dir, main page]

CN112988279A - Object processing method and device, electronic equipment and storage medium - Google Patents

Object processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112988279A
CN112988279A CN202110411407.3A CN202110411407A CN112988279A CN 112988279 A CN112988279 A CN 112988279A CN 202110411407 A CN202110411407 A CN 202110411407A CN 112988279 A CN112988279 A CN 112988279A
Authority
CN
China
Prior art keywords
implementation class
module
registration
dynamic
extensible
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.)
Granted
Application number
CN202110411407.3A
Other languages
Chinese (zh)
Other versions
CN112988279B (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.)
South Surveying & Mapping Technology Co ltd
Original Assignee
South GNSS Navigation 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 South GNSS Navigation Co Ltd filed Critical South GNSS Navigation Co Ltd
Priority to CN202110411407.3A priority Critical patent/CN112988279B/en
Publication of CN112988279A publication Critical patent/CN112988279A/en
Application granted granted Critical
Publication of CN112988279B publication Critical patent/CN112988279B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44594Unloading

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The invention discloses an object processing method, an object processing device, electronic equipment and a storage medium, which are used for solving the technical problem that an object created by a module in the prior art is released by other modules in the actual programming process. The method comprises the following steps: when an object creating instruction aiming at a preset registration implementation class is received, a dynamic extension module corresponding to the registration implementation class is obtained in a preset extensible object creating system; creating an object of a registration implementation class through a dynamic extension module; when a release instruction aiming at an object is received, a dynamic expansion module corresponding to the object is obtained in an expandable object creating system; and releasing the object through the dynamic expansion module.

Description

Object processing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of application development technologies, and in particular, to an object processing method and apparatus, an electronic device, and a storage medium.
Background
Currently, most enterprise-level application systems adopt a three-layer or multi-layer application mode. While most enterprise-level applications choose object-oriented programming techniques. An "object" is a set of data or a set of data and methods and processes for processing the data. There are two basic ways of generating objects. One to generate new objects based on prototype objects and one to generate new objects based on classes.
In practical applications, the creation and release of class objects can be realized by new and delete operators in the prior art, and in order to avoid memory leakage, the two operators are usually used in pairs.
In the actual programming process, it often happens that the creation of the class object and the release of the class object are performed in different modules (dynamic link library), so that errors are easy to occur.
Disclosure of Invention
The invention provides an object processing method, an object processing device, electronic equipment and a storage medium, which are used for solving the technical problem that an object created by a module in the prior art is released by other modules in the actual programming process.
The invention provides an object processing method, which comprises the following steps:
when an object creating instruction aiming at a preset registration implementation class is received, a dynamic extension module corresponding to the registration implementation class is obtained in a preset extensible object creating system;
creating an object of the registration implementation class through the dynamic extension module;
when a release instruction aiming at the object is received, the dynamic expansion module corresponding to the object is obtained in the expandable object creation system;
releasing the object through the dynamic expansion module.
Optionally, before the step of acquiring, in a preset extensible object creation system, a dynamic extension module corresponding to a preset registration implementation class when an object creation instruction for the preset registration implementation class is received, the method further includes:
creating an interface;
declaring the interface to a preset extensible object creation system;
writing an implementation class of the declared interface in the dynamic extension module;
and registering the implementation class to the extensible object creation system to obtain a registered implementation class.
Optionally, the step of creating, by the dynamic extension module, an object of the registration implementation class includes:
acquiring an identifier of the registration implementation class through the dynamic extension module;
obtaining a constructor of the registration implementation class based on the identifier;
and adopting the constructor to create an object of the registration implementation class.
Optionally, the step of releasing the object by the dynamic expansion module includes:
acquiring, by the dynamic extension module, a destructor of the registration implementation class based on the identifier;
and releasing the object by adopting the destructor.
The present invention also provides an object processing apparatus, comprising:
the first dynamic extension module acquisition module is used for acquiring a dynamic extension module corresponding to a registration implementation class in a preset extensible object creation system when an object creation instruction aiming at the preset registration implementation class is received;
the object creating module is used for creating the object of the registration implementation class through the dynamic extension module;
a second dynamic extension module obtaining module, configured to obtain, in the extensible object creation system, the dynamic extension module corresponding to the object when a release instruction for the object is received;
and the object releasing module is used for releasing the object through the dynamic expansion module.
Optionally, the method further comprises:
the interface creating module is used for creating an interface;
the interface declaration module is used for declaring the interface to a preset extensible object creation system;
the implementation class writing module is used for writing the implementation class of the declared interface in the dynamic extension module;
and the implementation class registration module is used for registering the implementation class to the extensible object creation system to obtain a registration implementation class.
Optionally, the object creation module includes:
the identifier acquisition submodule is used for acquiring the identifier of the registration implementation class through the dynamic expansion module;
a constructor obtaining sub-module, configured to obtain a constructor of the registration implementation class based on the identifier;
and the object creating submodule is used for creating the object of the registration implementation class by adopting the constructor.
Optionally, the object releasing module includes:
a destructor acquisition sub-module, configured to acquire, by the dynamic extension module, a destructor of the registration implementation class based on the identifier;
and the object release submodule is used for releasing the object by adopting the destructor.
The invention also provides an electronic device comprising a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to execute the object processing method according to any one of the above instructions in the program code.
The present invention also provides a computer-readable storage medium for storing program code for executing the object processing method as described in any one of the above.
According to the technical scheme, the invention has the following advantages: according to the invention, when an object creating instruction aiming at a preset registration implementation class is received, a dynamic extension module corresponding to the registration implementation class is obtained in a preset extensible object creating system; creating an object of a registration implementation class through a dynamic extension module; when a release instruction aiming at an object is received, a dynamic expansion module corresponding to the object is obtained in an expandable object creating system; and releasing the object through the dynamic expansion module. The technical problem that in the prior art, objects created through modules are released through other modules in the actual programming process is solved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a flowchart illustrating steps of an object processing method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of a method for processing an object according to another embodiment of the present invention;
fig. 3 is a schematic process diagram of an object processing method according to an embodiment of the present invention;
fig. 4 is a block diagram of an object processing apparatus according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides an object processing method, an object processing device, electronic equipment and a storage medium, which are used for solving the technical problem that an object created by a module in the prior art is released by other modules in the actual programming process.
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating steps of an object processing method according to an embodiment of the present invention.
The object processing method provided by the invention specifically comprises the following steps:
step 101, when an object creating instruction for a preset registration implementation class is received, acquiring a dynamic extension module corresponding to the registration implementation class in a preset extensible object creating system;
in the embodiment of the present invention, the dynamic extension module may be a dynamic link library or a component library.
Dynamic Link Library (DLL) is in the Windows operating system. One way to implement the shared library concept. The extensions of these functions ". dll", ". ocx" (library containing ActiveX controls), or ". drv" (legacy system driver). Dynamic linking provides a way that a process can call a function that does not belong to its executable code. The executable code for the functions is located in a DLL file that contains one or more functions that have been translated, linked and stored separately from the process in which they are used. DLLs also facilitate sharing of data and resources. Multiple applications can simultaneously access the contents of a single DLL copy in memory. Updates can be applied to individual modules more easily using a dynamically linked library without affecting other parts of the program. DLLs provide the role of a shared library as modular, allowing code and data in one DLL to be changed in common use by only a few applications without the need to change the applications themselves. Another benefit of modularity is the universal interface usage of the plug-ins. The single interface allows the old module to be seamlessly integrated with the previous application run as the new module does without requiring any changes to the application itself.
In the embodiment of the invention, an extensible object creation system can be constructed in advance, and a dynamic link library is deployed in the system. The number of the dynamic link libraries can be one or more.
In the embodiment of the invention, the extensible object creation system can be subjected to plug-in and componentization programming. Meanwhile, methods such as declaration of an interface, registration of implementation classes, creation and release of objects, loading and unloading of dynamic extension modules, acquisition of registration names of all registered implementation classes of a specified interface and the like can be provided.
In practical application, when an object creation instruction for a preset registration implementation class is received, a dynamic extension module corresponding to the registration implementation class can be acquired in a preset extensible object creation system to create an object.
102, creating an object of a registration implementation class through a dynamic extension module;
after the dynamic extension module for object creation is acquired, object creation of the registration implementation class can be performed through the method for creating the object provided by the extensible object creation system, and then the calling of the relevant method is completed through the interface corresponding to the registration implementation class. The registration implementation class and the interface thereof may be in the same dynamic extension module, or may not be in the same dynamic extension module.
103, when a release instruction for an object is received, acquiring a dynamic expansion module corresponding to the object in an expandable object creation system;
and 104, releasing the object through the dynamic expansion module.
In the embodiment of the present invention, after the object creation is completed, when a release instruction for the object is received, a dynamic extension module corresponding to a registration implementation class may be acquired in the extensible object creation system, so that the object is released through the dynamic extension module.
According to the invention, the dynamic extension module corresponding to the registration implementation class is acquired in the extensible object creation system, so that the object creation is carried out through the dynamic extension module. Meanwhile, according to the corresponding relation between the registration realization class and the dynamic extension module, when the object needs to be released, the same dynamic extension module can be obtained to perform the object release operation.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for processing an object according to another embodiment of the present invention. The method may specifically comprise the steps of:
step 201, creating an interface;
an interface is a collection of definitions of abstract methods and constant values, and essentially is a special abstract class which only contains the definitions of constants and methods, but no variable and method implementations. An interface generally defines how to use. Including how external programs are called and how calls between their internal programs.
In the embodiment of the invention, a user can write a required interface, such as an ICommand interface, in a general basic module/bottom module. The interface created by the embodiment of the invention needs to meet the following requirements: all methods must be purely virtual and contain no member variables, and the interface must be in a certain.
The pure virtual method is also called abstract function, generally, it only has function name, parameter and return value type, and does not need function body. This means that it has no function implementation and requires derivative classes to be implemented.
Pure virtual methods in C + + generally use 0 as a marker for such functions after signature of the function. In languages such as Java and C #, the function signature is decorated by directly using abstrat as a key word, which means that the method is a pure virtual method.
Step 202, creating a system declaration interface for a preset extensible object;
in embodiments of the present invention, after the interface creation is completed, the interface may be declared to the extensible object creation system.
In one example, declarations may be made by a declaration method provided by the EXTENSIBLE object creation system, such as EXTENSIBLE _ FACTORY _ DECLARE. A single interface only needs to be declared once. Meanwhile, the cpp file of the h file, where any include interface of the module where the interface is located, is defined by a declaration method EXTENSIBLE _ FACTORY _ DEFINE provided by the EXTENSIBLE object creation system.
Step 203, writing the implementation class of the declared interface in the dynamic extension module;
a class is a reflection in a computer of an entity in the real or thought world, which encapsulates data and operations on that data together. And the implementation class is used for realizing the functions of the interface.
In the embodiment of the present invention, the implementation class of the interface may be written in the dynamic extension module, and all pure virtual methods that inherit the interface may be implemented.
The technical requirements for realizing the classes are as follows: the constructor must satisfy the requirement of the extensible object creation system, the type of the first parameter must be const char, the type of the second parameter must be const void, and only two parameters can be contained.
Step 204, registering the implementation class to the extensible object creation system to obtain a registration implementation class;
after writing of the implementation class is completed, registration of the implementation class may be performed in a source file (CPP) of the implementation class of a dynamic extension module of the extensible authoring system.
Specifically, the registration implementation class can be obtained by registering through an EXTENSIBLE object creation system provided method of performing registration, namely, extensille _ factor _ REGISTER.
It should be noted that the specific implementation class can only register with the inherited interface; multiple names can be registered in the same implementation class, and only one registration is needed; the same interface may be registered by multiple implementation classes.
Step 205, when an object creating instruction for a preset registration implementation class is received, acquiring a dynamic extension module corresponding to the registration implementation class in a preset extensible object creating system;
in the embodiment of the present invention, after receiving an object creation instruction for a preset registration implementation class, the dynamic extension module may be loaded by a method provided by the extensible object creation system.
In one example, the method for loading the dynamic extension module may be extensible _ factor _ load _ dlls.
Step 206, creating an object of the registration implementation class through the dynamic extension module;
an object is an abstraction of an objective thing. Are variables having a class type. Classes and objects are the most basic concepts in object-oriented programming techniques. A class is an abstraction of an object, and an object is a concrete instance of a class. A class is a template that describes the behavior and state of a class of objects, and an object is an example of a class, having state and behavior. For example, a dog is a class, a dog is an object, and its state has: color, name, variety; the behaviors are as follows: rocking the tail, calling, eating, etc.
In the embodiment of the invention, after the loading operation of the dynamic extension module is completed, the object of the registration implementation class can be created through the dynamic extension module.
Specifically, the object is created through a method extensible _ factor _ get _ xxx provided by the extensible object creation system, where xxx is the name of the interface class.
In one example, step 206 may include the following sub-steps:
s61, acquiring the identifier of the registration implementation class through the dynamic extension module;
s62, acquiring a constructor of the registration implementation class based on the identifier;
s63, adopting the constructor to create the object of the register implementation class.
In a specific implementation, when creating an object, a constructor of an implementation class may be obtained through a global Map by using a specified identifier, and the constructor is called to create an object of an interface class.
The constructor is mainly used for initializing the object when the object is created, namely, the constructor gives an initial value to the object member variable and is always used in the statement for creating the object together with the new operator. A class may have multiple constructors that can be differentiated based on the number of parameters or the type of parameters.
Step 207, when a release instruction for the object is received, acquiring a dynamic extension module corresponding to the object in the extensible object creation system;
in the embodiment of the invention, when a release instruction for an object is received, the object can be released through a dynamic extension module for creating the object.
And step 208, releasing the object through the dynamic expansion module.
In the embodiment of the present invention, the object may be released through an extensible _ factor _ release _ xxx method for releasing the object provided by the extensible object creation system, where xxx is the name of the interface class.
In one example, step 208 may include the following sub-steps:
s81, acquiring a destructor of the registration implementation class based on the identifier through the dynamic expansion module;
and S82, releasing the object by using a destructor.
In specific implementation, when releasing an object, a destructor of an implementation class can be acquired through a designated identifier through a global Map, and the destructor is called to release the object of an interface class.
The destructor is opposite to the constructor, and when the object ends its life cycle, for example, when the function of the object is called, the destructor can be executed to release the object.
It should be noted that the constructors and destructors of all implementation classes must be in a fixed format, and have uniform parameter types, parameter orders, and parameter numbers.
According to the invention, the dynamic extension module corresponding to the registration implementation class is acquired in the extensible object creation system, so that the object creation is carried out through the dynamic extension module. Meanwhile, according to the corresponding relation between the registration realization class and the dynamic extension module, when the object needs to be released, the same dynamic extension module can be obtained to perform the object release operation.
For ease of understanding, embodiments of the present invention are described below by way of specific examples:
referring to fig. 3, fig. 3 is a process diagram of an object processing method according to an embodiment of the present invention.
As shown in FIG. 3, the extensible object creation system provides the declaration of the interface, the registration of the implementation classes, the creation and release of the object, and other operations, and also provides the methods of loading and unloading the dynamic extension module, obtaining the registered names of all the registered implementation classes of the specified interface, and the like. The realization principle is as follows:
1. the EXTENSIBLE _ FACTORY _ DECLARE is responsible for declaring a FACTORY method of a corresponding interface class, the declared method is EXTENSIBLE _ get _ xxx and the like, wherein xxx is the name of the interface class.
2. The EXTENSIBLE _ FACTORY _ DEFINE is responsible for implementing the declared FACTORY method, and the implementation principle is as follows: when the object is created, the constructor of the implementation class is obtained through the global Map through the appointed identifier, the constructor is called to create the object of the interface class, when the object is released, the destructor of the implementation class is obtained through the global Map through the appointed identifier, and the destructor is called to release the object of the interface class. Therefore, the constructors and destructors of all implementation classes must be in fixed format and have uniform parameter types, parameter orders and parameter numbers.
3. The EXTENSIBLE _ FACTORY _ REGISTER is responsible for registering the relevant information of the implementation class (class name, constructor, destructor, etc.) into the global Map.
4. The application program creates and releases the object through the extensible _ factor _ get _ xxx and the extensible _ factor _ release _ xxx methods of the extensible object creation system.
Examples of their use are as follows:
the/Common module needs to define DLL _ API _ SPEC __ declpsec (dllexport)
Command.h of/Common module
I/ICommand is an interface, all methods are pure virtual methods and do not contain member variables
class ICommand
{
virtual const char*getCommandName()=0;
virtual void setCommandName(const char*cmdName)=0;
};
#ifndef DLL_API_SPEC
#define DLL_API_SPEC__declspec(dllimport)
#endif
EXTENSIBLE_FACTORY_DECLARE(ICommand,DLL_API_SPEC);
Cpp of Common module
#include“Command.h”
EXTENSIBLE_FACTORY_DEFINE(ICommand);
v/CommandImp of component Module CommandSpective
class Command1
{
The constructor must be of the form, fixed type and number of parameters
Command1(const char*csaParam,const void*binParam)
{
}
const char*getCommandName()
{
return 0;
}
void setCommandName(const char*cmdName)
{
}
};
EXTENSIBLE _ FACTORY _ REGISTER (ICommand, Command1, "cmd 1", "Command 1");
class Command2
{
the constructor must be of the form, fixed type and number of parameters
Command2(const char*csaParam,const void*binParam)
{
}
const char*getCommandName()
{
return 0;
}
void setCommandName(const char*cmdName)
{
}
};
EXTENSIBLE _ FACTORY _ REGISTER (ICommand, Command2, "cmd 2", "Command 2");
use of/for ICommand interface
#include“Command.h”
// load first Command component
extensible_factory_load_dlls(“CommandSpectial”);
Creation of corresponding class objects through an extensible factory
ICommand*command1=extensible_factory_get_ICommand(“cmd1”,0);
// Release of corresponding class object through extensible factory
extensible_factory_release_ICommand(command1);
ICommand*command2=extensible_factory_get_ICommand(“cmd2”,0);
extensible_factory_release_ICommand(command2);
Referring to fig. 4, fig. 4 is a block diagram of an object processing apparatus according to an embodiment of the present invention.
An object processing apparatus provided in an embodiment of the present invention includes:
a first dynamic extension module obtaining module 401, configured to, when an object creating instruction for a preset registration implementation class is received, obtain, in a preset extensible object creating system, a dynamic extension module corresponding to the registration implementation class;
an object creating module 402, configured to create an object of the registration implementation class through the dynamic extension module;
a second dynamic extension module obtaining module 403, configured to, when a release instruction for an object is received, obtain, in the extensible object creation system, a dynamic extension module corresponding to the object;
an object release module 404, configured to release the object through the dynamic extension module.
In the embodiment of the present invention, the method further includes:
the interface creating module is used for creating an interface;
the interface declaration module is used for creating a system declaration interface for a preset extensible object;
the implementation class writing module is used for writing the implementation class of the declared interface in the dynamic extension module;
and the implementation class registration module is used for registering the implementation class to the extensible object creation system to obtain a registration implementation class.
In this embodiment of the present invention, the object creation module 402 includes:
the identifier acquisition submodule is used for acquiring the identifier of the registration implementation class through the dynamic expansion module;
a constructor obtaining submodule for obtaining a constructor of the registration implementation class based on the identifier;
and the object creating submodule is used for creating the object of the registration implementation class by adopting the constructor.
In this embodiment of the present invention, the object releasing module 404 includes:
a destructor acquisition sub-module for acquiring a destructor of the registration implementation class based on the identifier through the dynamic extension module;
and the object release submodule is used for releasing the object by adopting a destructor.
An embodiment of the present invention further provides an electronic device, where the device includes a processor and a memory:
the memory is used for storing the program codes and transmitting the program codes to the processor;
the processor is used for executing the object processing method of any embodiment of the invention according to instructions in the program code.
Embodiments of the present invention further provide a computer-readable storage medium, where the computer-readable storage medium is used to store a program code, and the program code is used to execute the object processing method according to any embodiment of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1.一种对象处理方法,其特征在于,包括:1. an object processing method, is characterized in that, comprises: 当接收到针对预设注册实现类的对象创建指令时,在预设的可扩展对象创建系统中获取所述注册实现类对应的动态扩展模块;When receiving the object creation instruction for the preset registration implementation class, obtain the dynamic expansion module corresponding to the registration implementation class in the preset extensible object creation system; 通过所述动态扩展模块创建所述注册实现类的对象;Create an object of the registration implementation class through the dynamic extension module; 当接收到针对所述对象的释放指令时,在所述可扩展对象创建系统中获取所述对象对应的所述动态扩展模块;When receiving the release instruction for the object, obtain the dynamic expansion module corresponding to the object in the extensible object creation system; 通过所述动态扩展模块释放所述对象。The object is released by the dynamic extension module. 2.根据权利要求1所述的方法,其特征在于,所述当接收到针对预设注册实现类的对象创建指令时,在预设的可扩展对象创建系统中获取所述注册实现类对应的动态扩展模块的步骤之前,还包括:2. The method according to claim 1, characterized in that, when receiving an object creation instruction for a preset registration implementation class, acquiring the corresponding registration implementation class in a preset extensible object creation system. Before the steps to dynamically expand the module, also include: 创建接口;create interface; 向预设的可扩展对象创建系统声明所述接口;declare the interface to a preset extensible object creation system; 在所述动态扩展模块中编写已声明的所述接口的实现类;Write the declared implementation class of the interface in the dynamic extension module; 向所述可扩展对象创建系统注册所述实现类,得到注册实现类。The implementation class is registered with the extensible object creation system to obtain a registered implementation class. 3.根据权利要求1所述的方法,其特征在于,所述通过所述动态扩展模块创建所述注册实现类的对象的步骤,包括:3. The method according to claim 1, wherein the step of creating the object of the registration implementation class by the dynamic extension module comprises: 通过所述动态扩展模块获取所述注册实现类的标识符;Obtain the identifier of the registered implementation class through the dynamic extension module; 基于所述标识符获取所述注册实现类的构造函数;obtaining the constructor of the registered implementation class based on the identifier; 采用所述构造函数,创建所述注册实现类的对象。Using the constructor, an object of the registration implementation class is created. 4.根据权利要求3所述的方法,其特征在于,所述通过所述动态扩展模块释放所述对象的步骤,包括:4. The method according to claim 3, wherein the step of releasing the object through the dynamic expansion module comprises: 通过所述动态扩展模块基于所述标识符,获取所述注册实现类的析构函数;Obtain the destructor of the registered implementation class based on the identifier by the dynamic extension module; 采用所述析构函数释放所述对象。The object is released using the destructor. 5.一种对象处理装置,其特征在于,包括:5. An object processing device, comprising: 第一动态扩展模块获取模块,用于当接收到针对预设注册实现类的对象创建指令时,在预设的可扩展对象创建系统中获取所述注册实现类对应的动态扩展模块;a first dynamic expansion module acquisition module, configured to acquire a dynamic expansion module corresponding to the registration implementation class in a preset extensible object creation system when receiving an object creation instruction for a preset registration implementation class; 对象创建模块,用于通过所述动态扩展模块创建所述注册实现类的对象;an object creation module for creating an object of the registration implementation class through the dynamic extension module; 第二动态扩展模块获取模块,用于当接收到针对所述对象的释放指令时,在所述可扩展对象创建系统中获取所述对象对应的所述动态扩展模块;a second dynamic expansion module acquisition module, configured to acquire the dynamic expansion module corresponding to the object in the extensible object creation system when receiving a release instruction for the object; 对象释放模块,用于通过所述动态扩展模块释放所述对象。The object release module is used for releasing the object through the dynamic expansion module. 6.根据权利要求5所述的装置,其特征在于,还包括:6. The apparatus of claim 5, further comprising: 接口创建模块,用于创建接口;Interface creation module for creating interfaces; 接口声明模块,用于向预设的可扩展对象创建系统声明所述接口;an interface declaration module for declaring the interface to a preset extensible object creation system; 实现类编写模块,用于在所述动态扩展模块中编写已声明的所述接口的实现类;an implementation class writing module for writing the declared implementation class of the interface in the dynamic extension module; 实现类注册模块,用于向所述可扩展对象创建系统注册所述实现类,得到注册实现类。The implementation class registration module is used for registering the implementation class with the extensible object creation system to obtain the registered implementation class. 7.根据权利要求5所述的装置,其特征在于,所述对象创建模块,包括:7. The apparatus according to claim 5, wherein the object creation module comprises: 标识符获取子模块,用于通过所述动态扩展模块获取所述注册实现类的标识符;an identifier acquisition submodule, used for acquiring the identifier of the registration implementation class through the dynamic extension module; 构造函数获取子模块,用于基于所述标识符获取所述注册实现类的构造函数;a constructor acquisition submodule, used for acquiring the constructor of the registered implementation class based on the identifier; 对象创建子模块,用于采用所述构造函数,创建所述注册实现类的对象。The object creation submodule is used for creating the object of the registration implementation class by using the constructor. 8.根据权利要求7所述的装置,其特征在于,所述对象释放模块,包括:8. The device according to claim 7, wherein the object release module comprises: 析构函数获取子模块,用于通过所述动态扩展模块基于所述标识符,获取所述注册实现类的析构函数;a destructor acquisition submodule, configured to acquire the destructor of the registered implementation class through the dynamic extension module based on the identifier; 对象释放子模块,用于采用所述析构函数释放所述对象。The object release submodule is used to release the object by using the destructor. 9.一种电子设备,其特征在于,所述设备包括处理器以及存储器:9. An electronic device, characterized in that the device comprises a processor and a memory: 所述存储器用于存储程序代码,并将所述程序代码传输给所述处理器;the memory is used to store program code and transmit the program code to the processor; 所述处理器用于根据所述程序代码中的指令执行权利要求1-4任一项所述的对象处理方法。The processor is configured to execute the object processing method according to any one of claims 1-4 according to the instructions in the program code. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质用于存储程序代码,所述程序代码用于执行权利要求1-4任一项所述的对象处理方法。10. A computer-readable storage medium, wherein the computer-readable storage medium is used to store program codes, and the program codes are used to execute the object processing method according to any one of claims 1-4.
CN202110411407.3A 2021-04-16 2021-04-16 Object processing method and device, electronic equipment and storage medium Active CN112988279B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110411407.3A CN112988279B (en) 2021-04-16 2021-04-16 Object processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110411407.3A CN112988279B (en) 2021-04-16 2021-04-16 Object processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112988279A true CN112988279A (en) 2021-06-18
CN112988279B CN112988279B (en) 2024-08-20

Family

ID=76340818

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110411407.3A Active CN112988279B (en) 2021-04-16 2021-04-16 Object processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112988279B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113568603A (en) * 2021-09-23 2021-10-29 广州中望龙腾软件股份有限公司 Component object creating and interface method calling method, terminal and storage device
CN116700834A (en) * 2023-08-07 2023-09-05 天津华来科技股份有限公司 App modularized loading method and system

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0992898A1 (en) * 1998-09-21 2000-04-12 Hewlett-Packard Company Using a namespace extension to selectively display files read from a computer readable drive
US20030225774A1 (en) * 2002-03-22 2003-12-04 Eran Davidov Conversion of an object model to a source file generation model
US20060036990A1 (en) * 2004-08-16 2006-02-16 Lockheed Martin Corporation Tool comprising systems engineering environment for meeting task requirements
CN102073520A (en) * 2010-12-30 2011-05-25 中国民航信息网络股份有限公司 Dynamic management system and method for C++ application program version
US20140289713A1 (en) * 2009-08-28 2014-09-25 Stacy T. Young Dynamic Media Content Instantiation Framework
CN104391745A (en) * 2014-10-13 2015-03-04 浪潮通用软件有限公司 Extensible object life cycle management method
CN105260177A (en) * 2015-09-21 2016-01-20 广东大工数值仿真研究院有限公司 SiPESC platform based Python extension module development method
CN108845837A (en) * 2018-07-09 2018-11-20 武汉斗鱼网络科技有限公司 A kind of method and electronic equipment detecting windows system running pattern
CN111209122A (en) * 2019-12-24 2020-05-29 广州华多网络科技有限公司 Interface calling method and device, electronic equipment and storage medium
CN112311773A (en) * 2020-10-15 2021-02-02 上海交通大学 Implementation method for intelligent automobile sensor interface system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0992898A1 (en) * 1998-09-21 2000-04-12 Hewlett-Packard Company Using a namespace extension to selectively display files read from a computer readable drive
US20030225774A1 (en) * 2002-03-22 2003-12-04 Eran Davidov Conversion of an object model to a source file generation model
US20060036990A1 (en) * 2004-08-16 2006-02-16 Lockheed Martin Corporation Tool comprising systems engineering environment for meeting task requirements
US20140289713A1 (en) * 2009-08-28 2014-09-25 Stacy T. Young Dynamic Media Content Instantiation Framework
CN102073520A (en) * 2010-12-30 2011-05-25 中国民航信息网络股份有限公司 Dynamic management system and method for C++ application program version
CN104391745A (en) * 2014-10-13 2015-03-04 浪潮通用软件有限公司 Extensible object life cycle management method
CN105260177A (en) * 2015-09-21 2016-01-20 广东大工数值仿真研究院有限公司 SiPESC platform based Python extension module development method
CN108845837A (en) * 2018-07-09 2018-11-20 武汉斗鱼网络科技有限公司 A kind of method and electronic equipment detecting windows system running pattern
CN111209122A (en) * 2019-12-24 2020-05-29 广州华多网络科技有限公司 Interface calling method and device, electronic equipment and storage medium
CN112311773A (en) * 2020-10-15 2021-02-02 上海交通大学 Implementation method for intelligent automobile sensor interface system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113568603A (en) * 2021-09-23 2021-10-29 广州中望龙腾软件股份有限公司 Component object creating and interface method calling method, terminal and storage device
CN116700834A (en) * 2023-08-07 2023-09-05 天津华来科技股份有限公司 App modularized loading method and system
CN116700834B (en) * 2023-08-07 2023-10-24 天津华来科技股份有限公司 App modularized loading method and system

Also Published As

Publication number Publication date
CN112988279B (en) 2024-08-20

Similar Documents

Publication Publication Date Title
EP3134810B1 (en) Dependency-driven co-specialization of specialized classes
CN106605212B (en) Modular common version management in dynamically linked runtime environments
US7131110B2 (en) Method and apparatus for generating a code bridge
KR100828302B1 (en) Software development and execution method using component reuse and dependency injection technology
CN111966357B (en) Operating system application compiling method and device and electronic equipment
CN112988279A (en) Object processing method and device, electronic equipment and storage medium
US20100083238A1 (en) Binary manipulation of intermediate-language code
US9639375B2 (en) Generation of language bindings for libraries using data from compiler generated debug information
CN105393216B (en) Run-time memory is adjusted
Khan et al. A study: selection of model metamodel and SPL tools for the verification of software product lines
Sessions Class construction in C and C++ object-oriented programming fundamentals
Wille Presenting C
KR101843518B1 (en) Method for creating dynamic object using abstract object and record medium thereof
Bachelet et al. Designing expression templates with concepts
Lee Memory management
Freeman Your First TypeScript Application
CN118963742A (en) SDK generation processing method and device
Kromann Advanced OOP Features
CN117369861A (en) Thread management policy configuration method and related device for application program
KR100624512B1 (en) Method for implementing object-oriented programming and memory for storing structure therefor
CN116578377A (en) RISC-V architecture construction method and device based on android simulator
Wise Objective View Poiint: the ABCs of writing C++ classes
KV Traceability of generated Business Controllers
Goyal Multiple Inheritance (MI)
HK1234856A1 (en) Modular co-versioning in a dynamically linked runtime environment

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20241204

Address after: 510000 Si Cheng Road, Tianhe District, Guangzhou, Guangdong Province, No. 39

Patentee after: SOUTH SURVEYING & MAPPING TECHNOLOGY CO.,LTD.

Country or region after: China

Address before: 510000 Tianhe District District, Guangzhou, Guangdong, 39 Tianhe District 4 Building A area, 5 floor, A area, 6 floor A area

Patentee before: GUANGZHOU SOUTH SATELLITE NAVIGATION INSTRUMENT Co.,Ltd.

Country or region before: China