Object extension method and device for object-oriented programming language

By registering and traversing base class objects in an object-oriented programming language, it solves the problem of dependencies between complex objects, improves object-oriented compatibility and development flexibility, and realizes dynamic expansion and replacement of objects.

CN112882685BActive Publication Date: 2024-09-27PETROCHINA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201911197495.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-11-29
Publication Date
2024-09-27
Estimated Expiration
2039-11-29

AI Technical Summary

Technical Problem

In the development of large-scale software systems, complex dependencies between objects lead to the inability to obtain the declaration of parent class objects, which has become a major difficulty in software development.

Method used

By establishing a base class object in an object-oriented programming language, registering it in an external function registry, traversing the registry to determine the target base class object, and then executing the target base class object, converting complex dependencies between objects into linear function registration Table to implement the unique functions of the object.

Benefits of technology

It improves object-oriented compatibility and development flexibility, simplifies the dependencies between objects, realizes forward support and backward compatibility of objects, and has dynamic expansion and replacement functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112882685B
    Figure CN112882685B
Patent Text Reader

Abstract

The present invention provides an object expansion method and device of an object-oriented programming language, the method comprising: establishing a base class object of the object-oriented programming language; registering the base class object to an external function registration table; traversing the function registration table and determining the target base class object when running a target base class object in the base class object called by an object-oriented program; and executing the determined target base class object. The present invention can effectively convert the complex dependency relationship between objects into a linear function registration table, perform linear traversal on the function registration table, thereby realizing the unique functions of the object, improving the object-oriented compatibility, and further improving the flexibility of object-oriented development.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer software, and in particular to an object expansion method and device of an object-oriented programming language. Background Art

[0002] Object-oriented programming language is one of the most important computer software development languages, and is widely used in software development in all walks of life. The three major characteristics of object-oriented mechanism are inheritance, encapsulation and polymorphism. Objects are derived from parent classes (base classes), inheriting the public methods and data of parent classes, and at the same time have their own unique methods and data. Any object, derived from the parent class, can be regarded as an object tree, and its functions and data are constantly enhanced. This is the core of object-oriented technology.

[0003] In software development, most of the methods and data of child objects are inherited from the parent class or the parent class of the parent class. To obtain the application of an object in an application, you need to know the declaration (header file) and implementation of all parent classes. This inherent dependency relationship of inheritance between objects is inevitable.

[0004] However, in the development of large-scale software systems, the complex dependencies between objects sometimes make it impossible to obtain the declaration of the parent class object, and sometimes it is impossible to obtain the declaration of the object, which becomes a major difficulty in software development. Summary of the invention

[0005] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0006] In a first aspect, the present invention provides a method for extending an object of an object-oriented programming language, comprising:

[0007] Establish base class objects of object-oriented programming languages;

[0008] Register the base class object to the external function registry;

[0009] When running a target base class object in the base class object called by an object-oriented program, traversing the function registration table and determining the target base class object;

[0010] The target base class object that performs the determination.

[0011] Wherein, the base class object of the object-oriented programming language is established, including:

[0012] Determine the distinguishing code, functional category code and name of the base class object;

[0013] Declare the distinguishing code, functional category code and name through virtual function to obtain the base class object.

[0014] Furthermore, it also includes:

[0015] Establishing a retrieval table for retrieving the base class object according to the name of the base class object and the hash function;

[0016] Correspondingly, the registering of the base class object to the external function registry includes:

[0017] The base class object and the search table are registered in an external function registration table.

[0018] The traversing the function registration table and determining the target base class object includes:

[0019] According to the target name of the target base class object, traverse the search table and determine the base class object corresponding to the target name in the search table;

[0020] Wherein, the base class object corresponding to the target name in the search table is determined as the target base class object.

[0021] The traversing the function registration table and determining the target base class object includes:

[0022] A target base class object among the base class objects is determined by the function class code and / or the name.

[0023] The function registration table is a linear table generated according to the base class object.

[0024] In a second aspect, the present invention provides an object expansion device of an object-oriented programming language, comprising:

[0025] Declaration unit, used to create base class objects of object-oriented programming languages;

[0026] A registration unit, used to register the base class object to an external function registry;

[0027] A traversal unit, used for traversing the function registration table and determining the target base class object when running a target base class object in the base class object called by an object-oriented program;

[0028] An execution unit is used to execute the determined target base class object.

[0029] Wherein, the declaration unit includes:

[0030] A partitioning module is used to determine the distinguishing code, functional category code and name of the base class object;

[0031] The declaration module is used to declare the distinguishing code, functional category code and name by means of virtual functions to obtain the base class object.

[0032] Furthermore, it also includes:

[0033] A retrieval module, used to establish a retrieval table for retrieving base class objects according to the name of the base class object and a hash function;

[0034] Correspondingly, the registration unit includes:

[0035] The registration subunit is used to register the base class object and the search table to an external function registration table.

[0036] Wherein, the traversal unit includes:

[0037] A first traversal module, used for traversing the search table and determining the base class object corresponding to the target name in the search table according to the target name of the target base class object;

[0038] Wherein, the base class object corresponding to the target name in the search table is determined as the target base class object.

[0039] Wherein, the traversal unit includes:

[0040] The second traversal module is used to determine the target base class object in the base class objects through the function category code and / or the name.

[0041] The function registration table is a linear table generated according to the base class object.

[0042] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the object extension method of the object-oriented programming language when executing the program.

[0043] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for extending an object of the object-oriented programming language.

[0044] It can be seen from the above technical scheme that the present invention provides a method and device for expanding objects of an object-oriented programming language, by establishing a base class object of an object-oriented programming language; registering the base class object to an external function registry; when running a target base class object in the base class object called by an object-oriented program, traversing the function registry and determining the target base class object; executing the determined target base class object, which can effectively convert the complex dependency relationship between objects into a linear function registry, and linearly traverse the function registry, thereby realizing the unique functions of the object, improving the object-oriented compatibility, and then improving the flexibility of object-oriented development. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0046] Figure 1 It is a first flow chart of the method for extending an object of an object-oriented programming language in an embodiment of the present invention.

[0047] Figure 2 This is a second flow chart of the method for extending an object of an object-oriented programming language in an embodiment of the present invention.

[0048] Figure 3 It is a schematic diagram of the structure of an object expansion device of an object-oriented programming language in an embodiment of the present invention.

[0049] Figure 4 Schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0051] The present invention provides an embodiment of an object extension method of an object-oriented programming language, see Figure 1 , the object extension method of the object-oriented programming language specifically includes the following contents:

[0052] S101: Establish a base class object of an object-oriented programming language;

[0053] In this step, establishing a base class object of an object-oriented programming language requires determining the distinguishing code, functional category code and name of the base class object; declaring the distinguishing code, functional category code and name through a virtual function virtual to obtain the base class object.

[0054] Among them, by distinguishing the codes, different base class objects can be distinguished by custom codes.

[0055] For example: virtual int type, declares the functional category code of the base class object, virtual const char*name, declares the name of the base class object.

[0056] It is understandable that the base class object is the parent class object.

[0057] S102: registering the base class object to an external function registry;

[0058] In this step, the created base class object is registered in an external function registry, where the function registry is a linear table generated based on the base class object and provides a series of functions, such as search, register, unregister, sort, and retrieve. When registering the base class object in the function registry, the new extended function is registered in the function registry and the specific extended function is unregistered by using the keyword regist and the keyword unregist respectively.

[0059] It should be noted that external refers to the outside of the object-oriented program being executed.

[0060] S103: when running a target base class object in the base class object called by an object-oriented program, traverse the function registration table and determine the target base class object;

[0061] In this step, an object-oriented program can be established based on an object-oriented programming language, and when the object-oriented program is run, the target base class object called in the object-oriented program is executed. Based on the target base class object, the target base class object is determined in the function registration table.

[0062] In a specific implementation, the target base class object can be determined in the function registration table by traversing the function registration table according to the target base class object. In a specific implementation, the target base class object in the base class object is determined by the function category code and / or the name.

[0063] Base class objects can be quickly retrieved and located by functional category code and / or name.

[0064] S104: Execute the determined target base class object.

[0065] In this step, a target base class object is determined in the function registration table and the determined target base class object is executed.

[0066] From the above description, it can be seen that the object extension method of the object-oriented programming language provided in the embodiment of the present invention establishes a base class object of the object-oriented programming language; registers the base class object to an external function registry; when running the target base class object in the base class object called by the object-oriented program, traverses the function registry and determines the target base class object; executes the determined target base class object, which can effectively convert the complex dependency relationship between objects into a linear function registry, and linearly traverses the function registry, thereby realizing the unique functions of the object, improving the object-oriented compatibility, and then improving the flexibility of object-oriented development.

[0067] In one embodiment of the present invention, see Figure 2 , step S101 also includes step S105, which specifically includes the following content:

[0068] S105: establishing a search table for searching the base class object according to the name of the base class object and the hash function;

[0069] Correspondingly, the step of registering the base class object to an external function registration table in S102 includes: S1021: registering the base class object and the search table to an external function registration table.

[0070] In this step, a working mechanism of rapid retrieval, positioning, and operation can be realized by establishing a retrieval table. In specific implementation, according to the target name of the target base class object, the retrieval table is traversed and the base class object corresponding to the target name in the retrieval table is determined;

[0071] Wherein, the base class object corresponding to the target name in the search table is determined as the target base class object.

[0072] Furthermore, a hash function is used to establish a retrieval table (hash table), which can realize a working mechanism of rapid retrieval, positioning, and operation, and then the base class object can be obtained through name search, which can speed up the retrieval through the retrieval table.

[0073] From the above description, it can be seen that the object extension method of the object-oriented programming language provided in the embodiment of the present invention can simplify the relationship between complex objects into an injection mechanism; this injection mechanism provides forward support and backward compatibility for objects; it provides that the extended functions of objects can be terminated or replaced; the interface of the object is simple and standard, has universality and consistency, and has a static description function of stability, determinism and invariance; the objects using this mechanism have functions that can be dynamically added, terminated, replaced, and adjusted, and have open characteristics.

[0074] The embodiment of the present invention provides a specific implementation of an object-oriented programming language object expansion device that can implement all the contents of the object expansion method of the object-oriented programming language, see Figure 3 , the object expansion device of the object-oriented programming language specifically includes the following contents:

[0075] A declaration unit 10, used to establish a base class object of an object-oriented programming language;

[0076] A registration unit 20, used for registering the base class object to an external function registration table;

[0077] A traversal unit 30, configured to traverse the function registration table and determine the target base class object when running a target base class object in the base class object called by an object-oriented program;

[0078] The execution unit 40 is used to execute the determined target base class object.

[0079] Wherein, the declaration unit includes:

[0080] A partitioning module is used to determine the distinguishing code, functional category code and name of the base class object;

[0081] The declaration module is used to declare the distinguishing code, functional category code and name by means of virtual functions to obtain the base class object.

[0082] Furthermore, it also includes:

[0083] A retrieval module 50, used to establish a retrieval table for retrieving base class objects according to the name of the base class object and a hash function;

[0084] Correspondingly, the registration unit includes:

[0085] The registration subunit is used to register the base class object and the search table to an external function registration table.

[0086] Wherein, the traversal unit includes:

[0087] A first traversal module, used for traversing the search table and determining the base class object corresponding to the target name in the search table according to the target name of the target base class object;

[0088] Wherein, the base class object corresponding to the target name in the search table is determined as the target base class object.

[0089] Wherein, the traversal unit includes:

[0090] The second traversal module is used to determine the target base class object in the base class objects through the function category code and / or the name.

[0091] The function registration table is a linear table generated according to the base class object.

[0092] The embodiment of the device for expanding an object of an object-oriented programming language provided by the present invention can be specifically used to execute the processing flow of the embodiment of the method for expanding an object of an object-oriented programming language in the above-mentioned embodiment. Its functions will not be repeated here, and reference may be made to the detailed description of the above-mentioned method embodiment.

[0093] From the above description, it can be seen that the object expansion device of the object-oriented programming language provided by the embodiment of the present invention establishes a base class object of the object-oriented programming language; registers the base class object to an external function registration table; when running the target base class object in the base class object called by the object-oriented program, traverses the function registration table and determines the target base class object; executes the determined target base class object, which can effectively convert the complex dependency relationship between objects into a linear function registration table, and linearly traverses the function registration table, thereby realizing the unique functions of the object, improving the object-oriented compatibility, and further improving the flexibility of object-oriented development.

[0094] The present application provides an embodiment of an electronic device for implementing all or part of the content of the object extension method of the object-oriented programming language. The electronic device specifically includes the following content:

[0095] Processor, memory, communication interface and bus; wherein the processor, memory and communication interface communicate with each other through the bus; the communication interface is used to realize information transmission between related devices; the electronic device can be a desktop computer, a tablet computer and a mobile terminal, etc., but the present embodiment is not limited thereto. In the present embodiment, the electronic device can be implemented with reference to the embodiment of the method for implementing the object of the object-oriented programming language and the embodiment of the device for implementing the object of the object-oriented programming language, and the contents thereof are incorporated herein and the repeated parts are not repeated.

[0096] Figure 4 FIG. 9 is a schematic block diagram of the system structure of the electronic device 9600 according to an embodiment of the present application. Figure 4 As shown, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. It is worth noting that Figure 4 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.

[0097] In one embodiment, the extended functions of the object of the object-oriented programming language can be integrated into the central processing unit 9100. The central processing unit 9100 can be configured to perform the following control: establish a base class object of the object-oriented programming language; register the base class object to an external function registration table; when running a target base class object in the base class object called by an object-oriented program, traverse the function registration table and determine the target base class object; and execute the determined target base class object.

[0098] From the above description, it can be seen that the electronic device provided by the embodiment of the present application, by establishing a base class object of an object-oriented programming language; registering the base class object to an external function registration table; when running a target base class object in the base class object called by an object-oriented program, traversing the function registration table and determining the target base class object; executing the determined target base class object, can effectively convert the complex dependency relationship between objects into a linear function registration table, perform a linear traversal of the function registration table, thereby realizing the unique functions of the object, improving object-oriented compatibility, and further improving the flexibility of object-oriented development.

[0099] In another embodiment, the expansion device of the object of the object-oriented programming language can be configured separately from the central processing unit 9100. For example, the expansion of the object of the object-oriented programming language can be configured as a chip connected to the central processing unit 9100, and the expansion function of the object of the object-oriented programming language can be realized through the control of the central processing unit.

[0100] like Figure 4 As shown, the electronic device 9600 may also include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily have to include Figure 4 In addition, the electronic device 9600 may also include Figure 4 For components not shown, reference may be made to the prior art.

[0101] like Figure 4 As shown, the central processing unit 9100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor device and / or logic device. The central processing unit 9100 receives input and controls the operation of various components of the electronic device 9600.

[0102] The memory 9140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 9100 may execute the program stored in the memory 9140 to implement information storage or processing, etc.

[0103] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.

[0104] The memory 9140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 9600 through the central processor 9100.

[0105] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).

[0106] The communication module 9110 is a transmitter / receiver 9110 that sends and receives signals via an antenna 9111. The communication module (transmitter / receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.

[0107] Based on different communication technologies, multiple communication modules 9110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module, etc. The communication module (transmitter / receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide an audio output via the speaker 9131 and receive an audio input from the microphone 9132, thereby realizing a common telecommunication function. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 9130 is also coupled to the central processor 9100, so that recording can be performed on the local machine through the microphone 9132, and the sound stored on the local machine can be played through the speaker 9131.

[0108] The embodiment of the present invention also provides a computer-readable storage medium capable of implementing all the steps in the method for extending an object of an object-oriented programming language in the above embodiment. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, all the steps in the method for extending an object of an object-oriented programming language in the above embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:

[0109] Establish a base class object of an object-oriented programming language; register the base class object to an external function registry; when running a target base class object in the base class object called by an object-oriented program, traverse the function registry and determine the target base class object; and execute the determined target base class object.

[0110] From the above description, it can be seen that the computer-readable storage medium provided by the embodiment of the present invention, by establishing a base class object of an object-oriented programming language; registering the base class object to an external function registry; when running a target base class object in the base class object called by an object-oriented program, traversing the function registry and determining the target base class object; executing the determined target base class object, can effectively convert the complex dependency relationship between objects into a linear function registry, perform linear traversal of the function registry, thereby realizing the unique functions of the object, improving object-oriented compatibility, and further improving the flexibility of object-oriented development.

[0111] Although the present invention provides method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only execution order. When the actual device or client product is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, in a parallel processor or multi-threaded processing environment).

[0112] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, devices (systems) or computer program products. Therefore, the embodiments of this specification may take the form of complete hardware embodiments, complete software embodiments or embodiments combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0113] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as a combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0114] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0115] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0116] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. In this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such a process, method, article or device. The orientation or position relationship indicated by the terms "upper", "lower", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. Unless otherwise expressly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other in the absence of conflict. The present invention is not limited to any single aspect, nor to any single embodiment, nor to any combination and / or permutation of these aspects and / or embodiments. Moreover, each aspect and / or embodiment of the present invention can be used alone or in combination with one or more other aspects and / or embodiments thereof.

[0117] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.

Claims

1. A method for extending an object in an object-oriented programming language. It is characterized in that include: Establish base class objects of object-oriented programming languages; Registering the base class object to an external function registry; wherein the external is the external of the object-oriented program being executed; When running a target base class object in the base class object called by an object-oriented program, traversing the function registration table and determining the target base class object; Execute the determined target base class object; the base class object is a parent class object; The base class object of the object-oriented programming language is established, comprising: Determine the distinguishing code, functional category code and name of the base class object; the distinguishing code is used to perform custom coding distinction on different base class objects, including: virtual int type, declaring the functional category code of the base class object, and virtual const char* name, declaring the name of the base class object; Declare the distinguishing code, functional category code and name through virtual functions to obtain the base class object; Establishing a retrieval table for retrieving the base class object according to the name of the base class object and the hash function; Correspondingly, the registering of the base class object to the external function registry includes: The base class object and the search table are registered in an external function registration table.

2. The object extension method of the object-oriented programming language according to claim 1, It is characterized in that The traversing the function registry and determining the target base class object comprises: According to the target name of the target base class object, traverse the search table and determine the base class object corresponding to the target name in the search table; Wherein, the base class object corresponding to the target name in the search table is determined as the target base class object.

3. The object extension method of the object-oriented programming language according to claim 1, It is characterized in that The traversing the function registry and determining the target base class object comprises: A target base class object among the base class objects is determined by the function class code and / or the name.

4. The object extension method of the object-oriented programming language according to claim 1, It is characterized in that The function registration table is a linear table generated according to the base class object.

5. An object extension device for an object-oriented programming language, It is characterized in that include: Declaration unit, used to create base class objects of object-oriented programming languages; A registration unit, used for registering the base class object to an external function registration table; wherein the external is the external of the object-oriented program being executed; A traversal unit, used for traversing the function registration table and determining the target base class object when running a target base class object in the base class object called by an object-oriented program; An execution unit, configured to execute the determined target base class object; the base class object is a parent class object; The declaration unit includes: A division module, used to determine the distinguishing code, functional category code and name of the base class object; the distinguishing code is used to perform custom coding distinction on different base class objects, including: virtual int type, declaring the functional category code of the base class object and virtual const char* name, declaring the name of the base class object; Declaration module, used to declare the distinguishing code, functional category code and name by means of virtual function to obtain the base class object; A retrieval module, used to establish a retrieval table for retrieving base class objects according to the name of the base class object and a hash function; Correspondingly, the registration unit includes: The registration subunit is used to register the base class object and the search table to an external function registration table.

6. The object expansion device of the object-oriented programming language according to claim 5, It is characterized in that The traversal unit comprises: A first traversal module, used for traversing the search table and determining the base class object corresponding to the target name in the search table according to the target name of the target base class object; Wherein, the base class object corresponding to the target name in the search table is determined as the target base class object.

7. The object expansion device of the object-oriented programming language according to claim 5, It is characterized in that The traversal unit comprises: The second traversal module is used to determine the target base class object in the base class objects through the function category code and / or the name.

8. The object expansion device of the object-oriented programming language according to claim 5, It is characterized in that The function registration table is a linear table generated according to the base class object.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the steps of the object extension method of the object-oriented programming language according to any one of claims 1 to 4 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method for extending an object of an object-oriented programming language according to any one of claims 1 to 4 are implemented.