CN113641341B - Dynamic self-adaption method and device of gdbus object interface - Google Patents

Dynamic self-adaption method and device of gdbus object interface Download PDF

Info

Publication number
CN113641341B
CN113641341B CN202110960975.9A CN202110960975A CN113641341B CN 113641341 B CN113641341 B CN 113641341B CN 202110960975 A CN202110960975 A CN 202110960975A CN 113641341 B CN113641341 B CN 113641341B
Authority
CN
China
Prior art keywords
interface
gdbus
alias
mapping relation
aliases
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110960975.9A
Other languages
Chinese (zh)
Other versions
CN113641341A (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.)
Fiberhome Telecommunication Technologies Co Ltd
Original Assignee
Fiberhome Telecommunication Technologies 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 Fiberhome Telecommunication Technologies Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Priority to CN202110960975.9A priority Critical patent/CN113641341B/en
Publication of CN113641341A publication Critical patent/CN113641341A/en
Application granted granted Critical
Publication of CN113641341B publication Critical patent/CN113641341B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/24Object-oriented
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/80Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
    • G06F16/83Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The invention relates to a dynamic self-adapting method and a device of a gdbus object interface. The method mainly comprises the steps of establishing a mapping relation table of interface aliases, interface true names and difference characterization of different interfaces, and manufacturing a unified interface description file; generating an interface source file according to the unified interface description file, compiling and packaging the interface source file, the system engineering source file and the mapping relation table to generate a unified software mirror image; when the software mirror image runs, the corresponding interface aliases are matched in the mapping relation table according to the difference characterization of different interfaces, and mirror image copies are created according to the aliases corresponding to the interface aliases; and redirecting the interface alias of the mirror image copy to the corresponding interface true name according to the mapping relation table, and referring the redirected interface copy as a gdbus object interface to complete dynamic self-adaption of the gdbus object interface. The invention can make the gdbus object interface dynamically and adaptively match in the unified software image.

Description

Dynamic self-adaption method and device of gdbus object interface
[ field of technology ]
The present invention relates to the field of communications technologies, and in particular, to a dynamic adaptive method and apparatus for a gdbus object interface.
[ background Art ]
The D-Bus is a message Bus system used for communication among processes, and can meet all requirements of the communication among the processes. The implementation version of the D-Bus protocol using the glib unified C language library is gdbus.
The D-Bus technology is an RPC (Remote Procedure Call ) IPC (Inter-Process Communication, inter-process communication) mechanism that abstracts data into interfaces, whose RPC is done through the schema of the object interface.
The interface description of gdbus is an XML file, and the gdbus-codegen tool is needed to generate an interface source file corresponding to C language, the interface source file of C language can be added into a compiling project, and the whole software project can generate a binary image by a compiler.
Because the source code of the corresponding programming language of the object interface gdbus before compiling and generating the mirror image must be generated in advance according to the interface description XML file, when the interface content of the same interface has differences due to the differences of equipment hardware or other conditions, the interface must correspond to the interface description XML file with a plurality of differences, further generate the object interface source code file with a plurality of differences, and compile the binary software mirror image with a plurality of differences. The difference of each software image corresponds to the interface difference of the demand one by one. In the prior art, the common interfaces of multiple devices have differences, so that the assumption of the common version software image cannot be realized.
In view of this, how to overcome the defects existing in the prior art and solve the above technical problems is a problem to be solved in the technical field.
[ invention ]
Aiming at the defects or improvement demands of the prior art, the invention provides a dynamic self-adaption method and a device for a gdbus object interface, which enable the object interface to be self-adaptively matched by the self-adaption running environment when software images run, and enable the same interface of gdbus to be different due to hardware or other condition differences, so that the dynamic self-adaption matching can be carried out in unified software images without adapting a plurality of different software images according to the differences.
The embodiment of the invention adopts the following technical scheme:
in a first aspect, the present invention provides a dynamic adaptation method of a gdbus object interface, including:
establishing a mapping relation table of interface aliases, interface true names and difference characterization of different interfaces, and making a unified interface description file;
generating an interface source file according to the unified interface description file, compiling and packaging the interface source file, the system engineering source file and the mapping relation table to generate a unified software mirror image;
when the software mirror image runs, the corresponding interface aliases are matched in the mapping relation table according to the difference characterization of different interfaces, and mirror image copies are created according to the aliases corresponding to the interface aliases;
and redirecting the interface alias of the mirror image copy to the corresponding interface true name according to the mapping relation table, and referring the redirected interface copy as a gdbus object interface to complete dynamic self-adaption of the gdbus object interface.
Further, the establishing a mapping relation table of interface aliases, interface true names and difference characterization of different interfaces, and making a unified interface description file specifically includes:
respectively naming different interfaces with differences as an interface alias;
creating a ternary mapping relation table about the difference characterization-interface alias-interface true name;
merging and manufacturing a unified interface description file according to the interface aliases and the interface description files of different interfaces;
wherein the plurality of interface aliases corresponds to an interface true name.
Further, the generating the interface source file according to the unified interface description file, compiling and packaging the interface source file, the system engineering source file and the mapping relation table to generate the unified software image specifically includes:
generating an interface source file corresponding to the appointed language interface according to the unified interface description file by using a code generation tool;
sending the interface source file, the system engineering source file and the mapping relation table into a compiler for compiling and packaging;
the compiler compiles and packages the unified software image.
Further, the code generation tool is a gdbus code generation tool gdbus-codegen.
Further, when the software mirror image runs, the software mirror image copy is created according to the alias interface corresponding to the interface alias, wherein the mapping relation table is matched with the corresponding interface alias according to the difference characterization of different interfaces, and the method specifically comprises the following steps:
when the software mirror image runs, the difference characterization is judged according to the different interfaces;
querying a mapping relation table through the difference characterization to obtain corresponding interface aliases;
and obtaining a corresponding alias interface by the interface alias, and creating a mirror image copy of the blue book by using the alias interface.
Further, the corresponding alias interface obtained by the interface alias is located in the read-only area, and the mirror image copy created by the alias interface for the blue book is located in the read-write area.
Further, the redirecting the interface alias of the mirror image copy to the corresponding interface true name according to the mapping relation table, referencing the redirected interface copy as the gdbus object interface, and completing the dynamic self-adaption of the gdbus object interface specifically includes:
redirecting the interface alias of the mirror image copy to the corresponding interface true name according to the mapping relation table;
the gdbus object interface refers to the interface copy of the mirror copy after redirection to replace the original blue book;
and finishing the dynamic self-adaption of the gdbus object interface.
Further, all interface description files are XML files.
Further, the software image is a binary software image.
On the other hand, the invention provides a dynamic self-adapting device of the gdbus object interface, which specifically comprises the following steps: the dynamic adaptation method of the gdbus object interface in the first aspect comprises at least one processor and a memory, wherein the at least one processor and the memory are connected through a data bus, and the memory stores instructions executed by the at least one processor, and the instructions are used for completing the dynamic adaptation method of the gdbus object interface in the first aspect after being executed by the processor.
Compared with the prior art, the embodiment of the invention has the beneficial effects that: when the same interface of gdbus is different due to hardware or other condition differences, the software images with a plurality of differences are not required to be adapted to the differences, dynamic self-adaptive matching can be carried out in the unified software images, different binary software images are not required to be generated for different hardware devices, image normalization is achieved, the cost of version management, source code branch management and synchronization is obviously reduced, and the wildcard ratio of the software images to the hardware devices is greatly improved.
[ description of the drawings ]
In order to more clearly illustrate the technical solution of the embodiments of the present invention, the drawings that are required to be used in the embodiments of the present invention will be briefly described below. It is evident that the drawings described below are only some embodiments of the present invention and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 is a flow chart of a dynamic adaptive method of a gdbus object interface according to embodiment 1 of the present invention;
FIG. 2 is a flowchart showing the steps 100 according to embodiment 1 of the present invention;
FIG. 3 is a flowchart showing a specific step 200 provided in embodiment 1 of the present invention;
FIG. 4 is a flowchart showing the steps 300 according to embodiment 1 of the present invention;
FIG. 5 is a flowchart showing a specific step 400 according to embodiment 1 of the present invention;
FIG. 6 is a schematic diagram of interface data of the gdbus object interface according to embodiment 2 of the present invention adapted to a B device interface;
FIG. 7 is a block diagram of a dynamic adaptive system of a gdbus object interface according to embodiment 3 of the present invention;
fig. 8 is a schematic structural diagram of a dynamic adaptive device of a gdbus object interface according to embodiment 4 of the present invention.
[ detailed description ] of the invention
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The present invention is an architecture of a specific functional system, so that in a specific embodiment, functional logic relationships of each structural module are mainly described, and specific software and hardware implementations are not limited.
In addition, the technical features of the embodiments of the present invention described below may be combined with each other as long as they do not collide with each other. The invention will be described in detail below with reference to the drawings and examples.
Example 1:
as shown in fig. 1, the embodiment of the invention provides a dynamic self-adapting method of a gdbus object interface, which specifically comprises the following steps.
Step 100: and establishing a mapping relation table of interface aliases, interface true names and difference characterization of different interfaces, and making a unified interface description file.
Step 200: and generating an interface source file according to the unified interface description file, and compiling and packaging the interface source file, the system engineering source file and the mapping relation table to generate a unified software mirror image.
Step 300: when the software mirror image runs, the corresponding interface aliases are matched in the mapping relation table according to the difference characterization of different interfaces, and mirror image copies are created according to the aliases corresponding to the interface aliases.
Step 400: and redirecting the interface alias of the mirror image copy to the corresponding interface true name according to the mapping relation table, and referring the redirected interface copy as a gdbus object interface to complete dynamic self-adaption of the gdbus object interface.
Based on the steps, when the interface is described, the invention forms the mapping relation of aliases and true names among different interfaces with differences by creating the mapping relation table of the aliases, the true names and the difference characterization of the interfaces, and compiles the mapping relation into a unified software mirror image. And when the software mirror image runs, matching the interface aliases of different interfaces according to the mapping relation table, creating mirror image copies, and finally redirecting to the corresponding interface true names to complete matching regression of the interfaces. By the design mode, the technical effect of software mirror image normalization can be achieved, and the purpose that the object interfaces are dynamically and adaptively matched in the unified software mirror image is achieved.
It should be noted that, in this embodiment, for convenience of description, the interfaces are divided into real name interfaces and alias interfaces, and names corresponding to the real name interfaces and the alias interfaces are the real name interfaces and the alias interfaces, where the real name interfaces (refer to the interfaces) have a real name interfaces (refer to the interfaces), and the alias interfaces have different alias interfaces according to different device difference characteristics.
As shown in fig. 2, in the present preferred embodiment, step 100 specifically includes the following steps.
Step 101: the different interfaces with differences are respectively named as an interface alias.
Step 102: a ternary mapping relationship table is created for the difference token-interface alias-interface true name.
Step 103: and merging the interface description files according to the interface aliases of different interfaces to manufacture a unified interface description file.
In the above steps, the difference between the different interfaces may be different in hardware or different in condition, and if one of the interfaces is different, an interface alias is named for the different interface. In general, the real names of the interfaces of the different objects share one interface, the interface aliases generated according to the different differences are different, and finally, a ternary mapping relation table about the difference characterization-interface aliases-interface real names is created according to the modes of each difference characterization corresponding to one different interface aliases and one same interface real name. In addition, each interface alias corresponds to one interface description file, and each interface description file is unified from the interface alias to one interface description file, which is the unified interface description file manufactured for the merging in the steps.
In the preferred embodiment, all interface description files are XML files. This is based on the property of gdbus, whose interface description file is an XML file.
As shown in fig. 3, in the present preferred embodiment, step 200 specifically includes the following steps.
Step 201: and generating an interface source file corresponding to the appointed language interface according to the unified interface description file by using a code generation tool.
Step 202: and sending the interface source file, the system engineering source file and the mapping relation table into a compiler for compiling and packaging.
Step 203: the compiler compiles and packages the unified software image.
In the above steps, the code generating tool is gdbus-codegen, which generates a source code file (interface source file or interface source code) corresponding to the specified language interface according to the unified interface description file manufactured by merging in step 100, and then sends the interface source code, the system engineering source code (system engineering source file) and the ternary mapping relation table generated in step 100 to a compiler, and packages the ternary mapping relation table into a unified software image package through the compiler.
As shown in fig. 4, in the present preferred embodiment, step 300 specifically includes the following steps.
Step 301: and when the software mirror image runs, the difference characterization is judged according to the different interfaces.
Step 302: and querying the mapping relation table through the difference characterization to obtain the corresponding interface aliases.
Step 303: and obtaining a corresponding alias interface by the interface alias, and creating a mirror image copy of the blue book by using the alias interface.
The step 300 and the step 400 which are not expanded in detail are steps when the software image is run after the step 100 and the step 200 are completed to be integrated with the software image, so the step 300 and the step 400 can be said to be steps of dynamic interface adaptation.
In the step 300, the dynamic self-adaptive matching of the interfaces is started, the software image starts to run at the moment, the running software image judges the difference characterization according to the different interfaces, then the interface aliases corresponding to the difference characterization are inquired and obtained through the rule that each difference characterization corresponds to one different interface aliases in the ternary mapping relation table, the corresponding interface aliases are obtained, then the interface aliases are used for obtaining the corresponding aliases which are only read, and finally the image copy is created for the blue book in the read-write area according to the aliases.
As shown in fig. 5, in the present preferred embodiment, step 400 specifically includes the following steps.
Step 401: and redirecting the interface alias of the mirror image copy to the corresponding interface true name according to the mapping relation table.
Step 402: the gdbus object interface references the interface copy after the mirror copy is redirected to replace the original blue book.
Step 403: and finishing the dynamic self-adaption of the gdbus object interface.
In the step 400, based on the mirror copy of the alias interface located in the read-write area created in the step 300, the step 400 redirects the interface alias of the mirror copy to the corresponding interface true name according to the corresponding relationship between the interface alias and the interface true name in the ternary mapping relationship table, so that the mirror copy originally belonging to the alias interface is redirected into the interface copy of the true name interface, the gdbus object interface refers to the interface copy of the true name interface to replace the mirror copy of the original alias interface, and the matching regression of the interface can be completed, namely the dynamic self-adaption of the gdbus object interface is completed.
In the preferred embodiment, the software image is a binary software image.
According to the embodiment, when the same interface of the gdbus is different due to hardware or other condition differences, the method and the device can be used for dynamically and adaptively matching a plurality of different software images in the unified software image without adapting to the differences, generating different binary software images for different hardware devices, achieving image normalization, remarkably reducing the cost of version management, source code branch management and synchronization, and greatly improving the wild ratio of the software images to the hardware devices.
Example 2:
based on the dynamic adaptive method of the gdbus object interface provided in embodiment 1, this embodiment 2 illustrates the running process of the unified mirror image of the three devices a, B, and C on the device B, so that the method of the present invention is clearer and more complete.
As shown in fig. 6, fig. 6 is an illustration of interface data for the gdbus object interface as adapted to the B device interface in the above example.
In the preferred embodiment, the device a, the device B, and the device C are three hardware devices with hardware differences, the names (the names are the real names of the interfaces) are com.
In the preferred embodiment, the interface description XML file of the hardware device a is defined as IA, and the IA describes the interface com.
Figure BDA0003222040620000091
The following is a visual comparison to facilitate an understanding of the technical solution of the present invention by describing the processing manner of the prior art and the present technology, respectively.
In the prior art, for these three types of hardware devices A, B, C, the XML file must first be described corresponding to three interfaces: IA. IB, IC. Then the XML file is described by the gdbus-codegen code generating tool gdbus according to the interface: IA. IB and IC respectively generate source files corresponding to the appointed language interfaces: IA ', IB ', IC '. And compiling and generating corresponding three binary software by a program compiler and respectively packaging the three binary software into a mirror image system: image, b.image, c.image.
The image is fixedly operated on the environment of the hardware device A, the image is fixedly operated on the environment of the hardware device B, and the image is fixedly operated on the environment of the hardware device C.
For the present invention, as shown in fig. 6, a ternary mapping table is first uniformly manufactured for the three hardware devices A, B, C: the difference characterization-interface alias-interface true name is as follows:
hardware a difference characterization-com.fibresome.hello.a-com.fibresome.hello
Hardware B difference characterization-com.fibresome.hello.b-com.fibresome.hello
Hardware C differential characterization-com.fibresome.hello.c-com.fibresome.hello
Then describing the XML file according to the interface aliases and three interfaces of the ternary mapping relation table: IA. IB and IC to make a unified interface description XML file I-ABC. Specifically, I-ABC is as follows:
<interface name="com.fiberhome.hello.a">
content:a
</interface>
<interface name="com.fiberhome.hello.b">
content:b
</interface>
<interface name="com.fiberhome.hello.c">
content:c
</interface>
the XML file is then described by the gdbus-codegen code generation tool gdbus according to a unified interface: I-ABC generates a source file corresponding to a specified language interface: I-ABC'. And then from this source file: I-ABC', system engineering source files and ternary mapping relation tables are compiled and packaged together to generate a unified binary software mirror image system ABC. The image mirror system is running on the environment of the hardware device A, B, C.
And when the system engineering runs, the system engineering queries the ternary mapping relation table according to the difference characterization, and the corresponding relation is obtained. Because of the gdbus technical rule, the binary software images that the interface data is in the read-only area (the interface data has only read permission and no rewrite permission, which is a protection technology of gdbus, the fundamental purpose is that the protection interface is not allowed to be changed once generated, the technology is also an enhancement to the existing implementation scheme, otherwise, the flexibility is restricted, or the gdbus technical rule only considers the existing implementation scheme, but not the improvement scheme similar to the invention.
After the corresponding relation is obtained, the corresponding interface alias is found out from the ternary mapping relation table by the difference characterization value. The aliases with interfaces can acquire the aliases interface data (the data refers to the interface description file corresponding to the aliases interface), and then solve the interface protection mechanism of gdbus by designing copy technology: and taking the alias interface data as a blue book (obtained from a read-only area), and creating a mirror image copy of the alias interface data in a controllable read-write area. And redirecting the interface name (namely the interface alias) of the mirror copy of the alias interface data in the readable and writable area to the real name of the interface by the relation of the ternary mapping relation table. The original interface blue book is replaced by the redirected mirror copy of the interface.
Thus, the dynamic self-adaption of the gdbus object interface is completed.
Specifically, as shown in fig. 6, in the case of having established a mapping relationship table, first, a difference characterization of the device B is obtained as B according to the decision, and the mapping relationship table is queried according to the difference characterization: b- -com.fiber home.hello.b- -com.fiber home.hello.b.corresponding interface aliases (i.e., com.fiber home.hello.b) can be found according to the corresponding relationship, corresponding alias interface data (i.e., an interface description file part corresponding to the device B, an upper right corner read-only area part pointed by an upper arrow in the figure) is obtained in a read-only area according to the interface aliases, then a copy of the device B alias interface is created in a read-write area, finally, according to the correspondence of a mapping relationship table, the copy is redirected to a corresponding interface true name (i.e., com.fiber home.hello) in the read-write area, and the redirected interface copy is equivalent to an interface copy of the true name interface, thereby completing matching regression of the interface. (in FIG. 6, the read-only area on the upper right is the description file of each alias interface, the read-only area on the lower right is the description file of the real name interface, and the read-write area on the upper left is the mirror copy of the alias interface corresponding to device b, and the read-write area on the lower left is the copy of the interface after redirection to the real name interface.)
Through the description of the specific examples, compared with the prior art, it can be seen that when the same interface of gdbus has different differences between hardware devices A, B, C, software images do not need to be configured for the differences between devices A, B, C, but dynamic self-adaptive matching can be performed in unified software images, image normalization is achieved, cost of version management, source code branching management and synchronization is obviously reduced, and the general-purpose ratio of software images to hardware devices is greatly improved.
Example 3:
based on the dynamic adaptation method of the gdbus object interface provided in embodiment 1 and embodiment 2, this embodiment 3 provides a dynamic adaptation system of a gdbus object interface corresponding to embodiment 1 and embodiment 2, as shown in fig. 7, where the system includes a unified interface description file generating module, a unified software image generating module, an image copy creating module, and an image copy redirecting module.
In the preferred embodiment, the above-mentioned unified interface description file generating module is configured to establish a mapping relationship table of interface aliases, interface true names and difference characterizations related to different interfaces, and make a unified interface description file. Specifically, the unified interface description file generation module may include an interface alias naming module, a ternary mapping relationship table creation module, and an interface description file creation module. The interface alias naming module is used for naming different interfaces with differences as an interface alias; the ternary mapping relation table creation module is used for creating a ternary mapping relation table about the difference characterization-interface alias-interface true name; the interface description file making module is used for making a unified interface description file according to the interface aliases and the interface description files of different interfaces.
In the preferred embodiment, the unified software image generating module is configured to generate an interface source file according to a unified interface description file, and compile and package the interface source file, a system engineering source file and a mapping relation table to generate a unified software image. Specifically, the unified software image generation module may include an interface source file generation module and a compilation module. The interface source file generation module generates an interface source file corresponding to the appointed language interface by using a code generation tool according to the unified interface description file; the compiling module comprises a compiler, an interface source file, a system engineering source file and a mapping relation table are obtained after the interface source file is generated, compiling and packaging are carried out, and finally, a unified software mirror image is compiled and packaged.
In the preferred embodiment, the image copy creation module is configured to match the corresponding interface aliases in the mapping relationship table according to the difference characterizations of different interfaces when the software image runs, and create the image copy according to the aliases corresponding to the interface aliases. Specifically, the image copy creation module may include a difference characterization decision module, an interface alias correspondence module, and an alias interface copy creation module. The difference characterization judgment module is used for judging difference characterization according to different interfaces when the software mirror image runs; the interface alias corresponding module queries a mapping relation table through the difference characterization to obtain a corresponding interface alias; and the alias interface copy creation module obtains a corresponding alias interface from the interface alias, and creates a mirror copy of the blue book by using the alias interface.
In the preferred embodiment, the above-mentioned mirror image copy redirection module is configured to redirect, according to the mapping relationship table, an interface alias of the mirror image copy to a corresponding interface true name, and refer to the redirected interface copy as a gdbus object interface, so as to complete dynamic adaptation of the gdbus object interface. Specifically, the mirror copy redirection module may include an interface true name redirection module and an interface copy replacement module. The interface true name redirection module is used for redirecting the interface alias of the mirror image copy to the corresponding interface true name according to the mapping relation table; the interface copy replacing module is used for enabling the gdbus object interface to replace the original blue book by leading the interface copy redirected by the mirror copy, so that dynamic self-adaption of the gdbus object interface is completed.
Example 4:
on the basis of the dynamic adaptation method and system of the gdbus object interface provided in the foregoing embodiments 1 to 3, the present invention further provides a dynamic adaptation device of the gdbus object interface, which may be used to implement the foregoing method and system, as shown in fig. 8, which is a schematic device architecture diagram of an embodiment of the present invention. The dynamic adaptation means of the gdbus object interface of the present embodiment comprises one or more processors 21 and a memory 22. In fig. 8, a processor 21 is taken as an example.
The processor 21 and the memory 22 may be connected by a bus or otherwise, for example in fig. 8.
The memory 22 is used as a nonvolatile computer readable storage medium for storing nonvolatile software programs, nonvolatile computer executable programs, and modules, as in the dynamic adaptation methods, systems of the gdbus object interface in embodiments 1 to 3. The processor 21 executes various functional applications and data processing of the dynamic adaptation device of the gdbus object interface by running nonvolatile software programs, instructions and modules stored in the memory 22, that is, implements the dynamic adaptation method and system of the gdbus object interface of embodiments 1 to 3.
The memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 22 may optionally include memory located remotely from processor 21, which may be connected to processor 21 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Program instructions/modules are stored in the memory 22 that, when executed by the one or more processors 21, perform the dynamically adaptive methods, systems, and methods of the gdbus object interface of embodiments 1-2 described above, e.g., perform the various steps and modules shown in fig. 1 and 7 described above.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in the various methods of the embodiments may be implemented by a program that instructs associated hardware, the program may be stored on a computer readable storage medium, the storage medium may include: read Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, and alternatives falling within the spirit and principles of the invention.

Claims (9)

1. A dynamic adaptation method of a gdbus object interface, comprising:
establishing a mapping relation table of interface aliases, interface true names and difference characterization of different interfaces, and making a unified interface description file;
generating an interface source file according to the unified interface description file, compiling and packaging the interface source file, the system engineering source file and the mapping relation table to generate a unified software mirror image;
when the software mirror image runs, the corresponding interface aliases are matched in the mapping relation table according to the difference characterization of different interfaces, and mirror image copies are created according to the aliases corresponding to the interface aliases;
redirecting the interface alias of the mirror image copy to the corresponding interface true name according to the mapping relation table, and referring the redirected interface copy as a gdbus object interface to complete dynamic self-adaption of the gdbus object interface;
the establishing a mapping relation table of interface aliases, interface true names and difference characterization of different interfaces, and making a unified interface description file specifically comprises the following steps:
respectively naming different interfaces with differences as an interface alias; creating a ternary mapping relation table about the difference characterization-interface alias-interface true name; merging and manufacturing a unified interface description file according to the interface aliases and the interface description files of different interfaces; wherein the plurality of interface aliases corresponds to an interface true name.
2. The method for dynamically adapting a gdbus object interface according to claim 1, wherein the generating an interface source file according to the unified interface description file, and compiling and packaging the interface source file, the system engineering source file and the mapping relation table to generate a unified software image specifically comprises:
generating an interface source file corresponding to the appointed language interface according to the unified interface description file by using a code generation tool;
sending the interface source file, the system engineering source file and the mapping relation table into a compiler for compiling and packaging;
the compiler compiles and packages the unified software image.
3. The method of dynamic adaptation of a gdbus object interface according to claim 2, wherein the code generation tool is a gdbus-codegen code generation tool of gdbus.
4. The method for dynamically adapting a gdbus object interface according to claim 1, wherein the step of creating a mirror copy of the software image according to the alias interface corresponding to the interface alias includes the steps of:
when the software mirror image runs, the difference characterization is judged according to the different interfaces;
querying a mapping relation table through the difference characterization to obtain corresponding interface aliases;
and obtaining a corresponding alias interface by the interface alias, and creating a mirror image copy of the blue book by using the alias interface.
5. The method of dynamically adapting a gdbus object interface according to claim 4, wherein the corresponding alias interface obtained by the interface alias is located in the read-only area, and the mirror copy created by the alias interface for the blueprint is located in the read-write area.
6. The method for dynamically adapting a gdbus object interface according to claim 1, wherein redirecting the interface alias of the mirror copy to the corresponding interface true name according to the mapping relationship table, referencing the redirected interface copy as the gdbus object interface, and completing dynamic adaptation of the gdbus object interface specifically comprises:
redirecting the interface alias of the mirror image copy to the corresponding interface true name according to the mapping relation table;
the gdbus object interface refers to the interface copy of the mirror copy after redirection to replace the original blue book;
and finishing the dynamic self-adaption of the gdbus object interface.
7. The method of any one of claims 1-6, wherein all interface description files are XML files.
8. The method of dynamic adaptation of a gdbus object interface according to any one of claims 1 to 6, wherein the software image is a binary software image.
9. A dynamic adaptation device of a gdbus object interface, characterized in that:
comprising at least one processor and a memory connected by a data bus, the memory storing instructions for execution by the at least one processor, the instructions, when executed by the processor, for performing the dynamic adaptation method of the gdbus object interface of any one of claims 1-8.
CN202110960975.9A 2021-08-20 2021-08-20 Dynamic self-adaption method and device of gdbus object interface Active CN113641341B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110960975.9A CN113641341B (en) 2021-08-20 2021-08-20 Dynamic self-adaption method and device of gdbus object interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110960975.9A CN113641341B (en) 2021-08-20 2021-08-20 Dynamic self-adaption method and device of gdbus object interface

Publications (2)

Publication Number Publication Date
CN113641341A CN113641341A (en) 2021-11-12
CN113641341B true CN113641341B (en) 2023-06-30

Family

ID=78423137

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110960975.9A Active CN113641341B (en) 2021-08-20 2021-08-20 Dynamic self-adaption method and device of gdbus object interface

Country Status (1)

Country Link
CN (1) CN113641341B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003289506A (en) * 2002-03-28 2003-10-10 Nippon Telegr & Teleph Corp <Ntt> Synchronism management apparatus for video-audio media and application, synchronism management method, synchronism management program, and recording medium recorded with such synchronism management program
CN109815293A (en) * 2019-01-21 2019-05-28 烽火通信科技股份有限公司 The method and system of gdbus multistage dynamic instance are realized in conjunction with self-defining data

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI376672B (en) * 2007-06-21 2012-11-11 Novatek Microelectronics Corp Memory-control device for display device
US20130275943A1 (en) * 2012-04-11 2013-10-17 Oracle International Corporation Determining interface differences between different versions of an operating system
CN103984582B (en) * 2014-06-04 2017-05-31 网易(杭州)网络有限公司 A kind of hot update method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003289506A (en) * 2002-03-28 2003-10-10 Nippon Telegr & Teleph Corp <Ntt> Synchronism management apparatus for video-audio media and application, synchronism management method, synchronism management program, and recording medium recorded with such synchronism management program
CN109815293A (en) * 2019-01-21 2019-05-28 烽火通信科技股份有限公司 The method and system of gdbus multistage dynamic instance are realized in conjunction with self-defining data

Also Published As

Publication number Publication date
CN113641341A (en) 2021-11-12

Similar Documents

Publication Publication Date Title
KR102209276B1 (en) Messaging protocol communication management
JP5400305B2 (en) Method, apparatus, and computer program for improving expression processing
US5778228A (en) Method and system for transferring remote procedure calls and responses over a network
US7739382B2 (en) Dynamic extension of network-accessible services
US6931647B1 (en) Protocol agnostic web listener
US20210096825A1 (en) Systems, methods, and apparatuses for local web components development within a cloud based computing environment
CN103399734A (en) Method for generating REST service and achieving REST and corresponding equipment
CN108306844B (en) Method for API communication between server and client
CN111736954B (en) Multi-intelligent contract virtual machine implementation method, multi-intelligent contract virtual machine and system
CN111371679A (en) Method for realizing API gateway based on kubernets and Kong
US20060048095A1 (en) Local type alias inference system and method
WO1997014091A1 (en) Object-oriented method maintenance mechanism that does not require cessation of the computer system
US8332493B2 (en) Directory server plug-in call ordering
CN113641341B (en) Dynamic self-adaption method and device of gdbus object interface
US6859836B2 (en) System and method for providing look ahead socket generation
EP2321932B1 (en) Probabilistic dynamic router-server mesh routing
US9015682B1 (en) Computer code transformations to create synthetic global scopes
CN112506516A (en) Code generation method of security protocol, computer and storage medium
CN105786613A (en) Method for improving utilization rate of internal memory
CN115658140A (en) SDK packaging method, device, terminal and storage medium
CN111399850B (en) Multi-language intelligent contract compiling method based on block chain
CN112988126A (en) CDN service customization method and system
CN115827120B (en) User state network stack calling and user state interface setting method and device
Messina et al. Design and evaluation of a high‐level Grid communication infrastructure
US20190087165A1 (en) System and method for implementing dynamic strategies of computing infrastructure using a domain-specific language for cloud services infrastructure

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