CN110413270A - A kind of general creation method and device of dbus object - Google Patents

A kind of general creation method and device of dbus object Download PDF

Info

Publication number
CN110413270A
CN110413270A CN201910628115.8A CN201910628115A CN110413270A CN 110413270 A CN110413270 A CN 110413270A CN 201910628115 A CN201910628115 A CN 201910628115A CN 110413270 A CN110413270 A CN 110413270A
Authority
CN
China
Prior art keywords
dbus
interface
creation
image parameter
parameter
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.)
Withdrawn
Application number
CN201910628115.8A
Other languages
Chinese (zh)
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.)
Suzhou Wave Intelligent Technology Co Ltd
Original Assignee
Suzhou Wave Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Wave Intelligent Technology Co Ltd filed Critical Suzhou Wave Intelligent Technology Co Ltd
Priority to CN201910628115.8A priority Critical patent/CN110413270A/en
Publication of CN110413270A publication Critical patent/CN110413270A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The present invention relates to a kind of general creation methods of dbus object, comprising: creative management interface and object interface;Image parameter is constructed, which includes the information of at least one dbus object;Creation function is defined in management interface, the input parameter of the creation function is image parameter, and the output parameter of the creation function is dbus object;The dbus object exported by creation function is added in object interface;Management interface and object interface are called, in management interface input object parameter, to create at least one dbus object in object interface.When creating dbus object, created management interface and object interface need to be only called, input object parameter can replace the interface under multiple and different service, create multiple dbus objects in object interface according to the creation function of management interface.The simplification that dbus Object Creation is realized using technical solution of the present invention, eliminates the process for calling the interface under different service, and the dbus object created is all under the same interface, easy-to-look-up, maintenance and management.

Description

A kind of general creation method and device of dbus object
Technical field
The present invention relates to the D-Bus technical fields of linux system.The invention further relates to a kind of the general of dbus object Creation method and device.
Background technique
D-Bus data/address bus is a kind of advanced inter-process communication mechanisms on linux system, is issued by most of Linux Version is used, and the usable D-Bus of developer realizes the interprocess communication task of various complexity.Interprocess communication refer to two into Some techniques or methods of journey or cross-thread transmission data or signal.Process is the minimum unit of computer system distribution resource. Each process has a part of independent system resource of oneself, is isolation each other.In order to visit different processes mutually It asks resource and carries out co-ordination, just there is interprocess communication.Dbus object (dbus object) is an abstract concept, i.e., Process is registered on D-Bus, is created object, is received information by object.
Most of programming languages have the library of dbus, and for program by calling corresponding interface, completion creates the process of objcet, Object is safeguarded by program itself.However, need to realize the process of creation object in the prior art by program, it is different Object under service needs to call the interface of corresponding service, and the logic and language of programming are relatively complicated.In addition, similar The interface of function is dispersed in different programs, cannot be managed collectively.
It is, therefore, desirable to provide a kind of technical solution for solving disadvantages mentioned above in the prior art, quickly and conveniently creates Object, and the object of identity function is safeguarded by unified program.
Summary of the invention
On the one hand, the present invention is based on above-mentioned purposes to propose a kind of general creation method of dbus object, comprising:
Creative management interface and object interface;
Image parameter is constructed, which includes the information of at least one dbus object;
Define creation function in management interface, the input parameter of the creation function is image parameter, the creation function it is defeated Parameter is dbus object out;
The dbus object exported by creation function is added in object interface;
Management interface and object interface are called, in management interface input object parameter, to create at least one in object interface A dbus object.
The embodiment of the general creation method of dbus object according to the present invention, wherein the information of dbus object includes dbus The title of object.
The embodiment of the general creation method of dbus object according to the present invention, wherein the information of dbus object is further wrapped Include the attribute of dbus object and the value of the attribute.
The embodiment of the general creation method of dbus object according to the present invention, wherein image parameter is configured to map Dictionary building, wherein the key key of dictionary is configured to the title of dbus object, and the value value of dictionary is configured to the category of dbus object Property and the attribute value or sky.
The embodiment of the general creation method of dbus object according to the present invention, wherein creation function be configured to according to institute it is defeated The image parameter entered obtains the information of at least one dbus object, and exports corresponding dbus object.
The embodiment of the general creation method of dbus object according to the present invention, wherein method further comprise: pass through Dbus library function establishes the connection with system bus.
On the other hand, the invention also provides a kind of general creating device of dbus object, which includes:
At least one processor;With
Memory, the memory are stored with the program code that processor can be run, which runs by processor Shi Zhihang following steps:
Creative management interface and object interface;
Image parameter is constructed, which includes the information of at least one dbus object;
Define creation function in management interface, the input parameter of the creation function is image parameter, the creation function it is defeated Parameter is dbus object out;
The dbus object exported by creation function is added in object interface;
Management interface and object interface are called, in management interface input object parameter, to create at least one in object interface A dbus object.
The embodiment of the general creating device of dbus object according to the present invention, wherein creation function be configured to according to institute it is defeated The image parameter entered obtains the information of at least one dbus object, and exports corresponding dbus object.
The embodiment of the general creating device of dbus object according to the present invention, wherein the information of dbus object includes dbus Title, the attribute of dbus object and the value of the attribute of object.
The embodiment of the general creating device of dbus object according to the present invention, wherein image parameter is configured to map Dictionary building, wherein the key key of dictionary is configured to the title of dbus object, and the value value of dictionary is configured to the category of dbus object Property and the attribute value or sky.
By adopting the above technical scheme, the present invention at least has the following beneficial effects: in the inventive solutions, by institute The management interface and object interface of creation substitute and create the distinct interface that dbus object is called under different service, utilize institute The information of multiple dbus objects is integrated into an input parameter by the image parameter of definition, passes through creation bound in management interface Function generates multiple dbus objects.When executing creation dbus object according to the method for the present invention, created pipe need to be only called Interface and object interface are managed, input object parameter can replace the interface under multiple and different service, according to management interface It creates function and creates multiple dbus objects in object interface.That is, realizing dbus pairs using technical solution of the present invention As the simplification of creation, the process for calling the interface under different service is eliminated, and the dbus object created is all same Under a interface, easy-to-look-up, maintenance and management.
The present invention provides the various aspects of embodiment, should not be taken to limit protection scope of the present invention.According to retouching herein The technology stated is contemplated that other embodiment, this is to those skilled in the art in research the following drawings and specific It will be apparent after embodiment, and these embodiments intention is comprised in scope of the present application.
Below with reference to the accompanying drawings it is explained in greater detail and describes the embodiment of the present invention, but they should not be construed as this The limitation of invention.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be in the prior art and embodiment description Required attached drawing is briefly described, and the component in attached drawing is not drawn necessarily to scale, and can be omitted relevant Element, or ratio may be amplified in some cases, it is described herein novel special to emphasize and to be clearly shown Sign.In addition, as it is known in the art, structural order can be arranged differently.
In figure:
Fig. 1 shows the schematic block diagram of the embodiment of the general creation method of dbus object according to the present invention;With
Fig. 2 shows the signals of the embodiment of the general creation method of dbus object according to the present invention creation dbus object Figure.
Specific embodiment
Although the present invention can be implemented in a variety of manners, it is shown in the accompanying drawings and will be described below some show Example property and non-limiting embodiment, it is understood that, the disclosure will be considered as that example of the invention is not intended this Invention is limited to illustrated specific embodiment.
Fig. 1 shows the schematic block diagram of the embodiment of the general creation method of dbus object according to the present invention.Such as figure Shown, this method at least includes the following steps:
S1: creative management interface and object interface;
S2: building image parameter, which includes the information of at least one dbus object;
S3: creation function is defined in management interface, the input parameter of the creation function is image parameter, the creation function Output parameter is dbus object;
S4: the dbus object exported by creation function is added in object interface;
S5: calling management interface and object interface, in management interface input object parameter, to create at least in object interface One dbus object.
Design according to the present invention replaces the interface under different service using unified interface, therefore in step S1 In, a pair of general interface interface of creation, i.e. manager interface management interface and objects interface Object interface is uniformly created and is managed all dbus objects being related to the two interfaces.
Image parameter is then constructed in step s 2, which includes the information of at least one dbus object.That is, rule A fixed image parameter, including the information of all dbus objects of required creation.As a result, dbus pairs of creation in need The Information encapsulation of elephant in a parameter, and convenient for it is subsequent by all dbus Object Creations under the same interface, while Convenient for management.
After step S2 completes the building of image parameter, step S3 is managed in the manager interface that step S1 is created Interface definition creation function, the input parameter of the creation function are the image parameter of step S2 building, the output of the creation function Parameter is dbus object to be created.
It is then added into step S4 by the dbus object that the creation function of step 3 exports and is created in step S1 Objects interface object interface, in case subsequent calling.
After completing above-mentioned steps S1 to S4, when carrying out actual dbus Object Creation, only need in invocation step S1 The management interface and object interface of creation, the image parameter of input step S2 building can pass through the fortune of the creation function of step 3 It calculates and creates at least one dbus object.
That is, according to the method for the present invention, when executing creation dbus object, need to only call unified management interface And object interface, input object parameter can replace the interface under multiple and different service, according to the creation letter of management interface Number creates multiple dbus objects in object interface.The simplification of dbus Object Creation is realized using technical solution of the present invention, is saved The dbus object for having gone the process of the interface under the different service of calling, and having been created conveniently is looked into all under the same interface It looks for, maintenance and management.
In some embodiments of the general creation method of dbus object of the invention, dbus object that step 2 is related to Information includes the title of dbus object.In the other embodiment of the general creation method of dbus object of the invention, dbus The information of object further comprises the attribute of dbus object and the value of the attribute.That is, the information of dbus object is on the one hand Title including dbus object and optionally include the attribute of one or more dbus objects and the value of the attribute;On the other hand The information of dbus object can also only include the title of dbus object, omit the attribute of dbus object and the value of the attribute.
In some embodiments of the general creation method of dbus object of the invention, image parameter involved in step S2 It is configured to the building of map dictionary, wherein the key key of dictionary is configured to the title of dbus object, and the value value of dictionary is configured to The attribute of dbus object and the value of the attribute or sky.By taking following two dbus object as an example: first dbus object oriented is App1, first attribute is property1, the value of the attribute is value1, and second attribute is property2, the category Property value be value2, etc.;Second dbus object oriented is app2, and first attribute be property3, the attribute Value is value3, and second attribute is property4, the value of the attribute is value4, etc..To create at least the above two Related image parameter format sample is as follows for dbus object:
In several embodiments of the general creation method of dbus object of the invention, creation function is configured to defeated according to institute The image parameter entered obtains the information of at least one dbus object, exports corresponding dbus object.The creation function of step S3 from Input parameter, that is, image parameter in extract at least one preferably multiple dbus objects information, according to corresponding calculating process according to The information of at least one of image parameter preferably multiple dbus objects, correspondingly at least one preferably multiple dbus pairs of output As.
Fig. 2 shows the signals of the embodiment of the general creation method of dbus object according to the present invention creation dbus object Figure.In the embodiment shown in Figure 2 by calling manager interface management interface and objects interface couple As interface, the information of four dbus objects is inputted in manager interface management interface, and by manager Corresponding four dbus objects of output are added to objects interface object interface by interface management interface.Extremely This, the dbus object related to is by unified interface i.e. manager interface management interface and objects Interface object interface creation, and the dbus object created all under objects interface object interface in case Subsequent calls.
In several embodiments of the general creation method of dbus object of the invention, method further comprises: passing through Dbus library function establishes the connection with system bus.That is, being established and system bus according to the respective function in dbus library function The creation and use of dbus object are realized in the connection of system bus based on this.
On the other hand, the invention also provides a kind of general creating device of dbus object, which includes: at least one Processor;And memory, the program code execute following steps when being run by processor:
S1: creative management interface and object interface;
S2: building image parameter, which includes the information of at least one dbus object;
S3: creation function is defined in management interface, the input parameter of the creation function is image parameter, the creation function Output parameter is dbus object;
S4: the dbus object exported by creation function is added in object interface;
S5: calling management interface and object interface, in management interface input object parameter, to create at least in object interface One dbus object.
In several embodiments of the general creating device of dbus object of the invention, the creation function of step S3 is configured to The information of at least one dbus object is obtained according to the image parameter inputted, and exports corresponding dbus object.
In some embodiments of the general creating device of dbus object of the invention, the information of the dbus object of step S2 Title, the attribute of dbus object and the value of the attribute including dbus object.
In one or more embodiments of the general creating device of dbus object of the invention, the image parameter of step S2 It is configured to the building of map dictionary, wherein the key key of dictionary is configured to the title of dbus object, and the value value of dictionary is configured to The attribute of dbus object and the value of the attribute or sky.
It can be various electric terminal equipments, such as mobile phone, a number that the embodiment of the present invention, which discloses described device, equipment etc., Word assistant (PDA), tablet computer (PAD), smart television etc., are also possible to large-scale terminal device, such as server, therefore this hair Protection scope disclosed in bright embodiment should not limit as certain certain types of device, equipment.The embodiment of the present invention discloses described Client can be with the combining form of electronic hardware, computer software or both be applied to any one of the above electric terminal In equipment.
Computer readable storage medium (such as memory) as described herein can be volatile memory or non-volatile Memory, or may include both volatile memory and nonvolatile memory.As an example and not restrictive, it is non-easy The property lost memory may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically-erasable Programming ROM (EEPROM) or flash memory.Volatile memory may include random access memory (RAM), which can To serve as external cache.As an example and not restrictive, RAM can be obtained in a variety of forms, such as synchronous RAM (DRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate SDRAM (DDR SDRAM), enhancing SDRAM (ESDRAM), synchronization link DRAM (SLDRAM) and directly Rambus RAM (DRRAM).The storage of disclosed aspect is set The standby memory for being intended to including but not limited to these and other suitable type.
By adopting the above technical scheme, the present invention at least has the following beneficial effects: in the inventive solutions, by institute The management interface and object interface of creation substitute and create the distinct interface that dbus object is called under different service, utilize institute The information of multiple dbus objects is integrated into an input parameter by the image parameter of definition, passes through creation bound in management interface Function generates multiple dbus objects.When executing creation dbus object according to the method for the present invention, created pipe need to be only called Interface and object interface are managed, input object parameter can replace the interface under multiple and different service, according to management interface It creates function and creates multiple dbus objects in object interface.That is, realizing dbus pairs using technical solution of the present invention As the simplification of creation, the process for calling the interface under different service is eliminated, and the dbus object created is all same Under a interface, easy-to-look-up, maintenance and management.
It should be understood that technically in feasible situation, above in relation to technical characteristic cited by different embodiments It can be combined with each other, to form the additional embodiment in the scope of the invention.In addition, particular example as described herein and embodiment It is non-limiting, and structure explained above, step and sequence can be revised accordingly without departing from the present invention Protection scope.
In this application, the use of disjunctive is intended to include conjunction.Fixed or indefinite article use is not intended to Indicate radix.Specifically, be intended to indicate that the reference of "the" object or " one " and "one" object can in multiple such objects One of energy.However, removing and non-clearly limiting although element disclosed by the embodiments of the present invention can be described or be required in the form of individual It is made as odd number, it is understood that be multiple.In addition it is possible to use conjunction "or" conveys simultaneous feature, rather than Repelling programs.In other words, conjunction "or" is understood to include "and/or".Term " includes " is inclusiveness and has Range identical with "comprising".
Above-described embodiment, especially any " preferably " embodiment are the possibility examples of embodiment, and just to clear Chu understands the principle of the present invention and proposes.It, can without departing substantially from the spirit and principle of technique described herein To make many change and modification to above-described embodiment.All modifications are intended to be included in the scope of the present disclosure.

Claims (10)

1. a kind of general creation method of dbus object, which is characterized in that the described method includes:
Creative management interface and object interface;
Image parameter is constructed, the image parameter includes the information of at least one dbus object;
Creation function is defined in the management interface, the input parameter of the creation function is the image parameter, the creation The output parameter of function is the dbus object;
In object interface addition by the dbus object of the creation function output;
The management interface and the object interface are called, the image parameter is inputted in the management interface, described right As interface creates at least one described dbus object.
2. the general creation method of dbus object according to claim 1, which is characterized in that the information of the dbus object Title including the dbus object.
3. the general creation method of dbus object according to claim 2, which is characterized in that the information of the dbus object It further comprise the attribute of the dbus object and the value of the attribute.
4. the general creation method of dbus object according to claim 3, which is characterized in that the image parameter is configured to It is constructed based on map dictionary, wherein the key key of dictionary is configured to the title of the dbus object, and the value value of dictionary is configured to institute State the attribute of dbus object and the value or sky of the attribute.
5. the general creation method of dbus object according to claim 1, which is characterized in that the creation function is configured to The information of at least one dbus object is obtained according to the image parameter inputted, and is exported described dbus pairs corresponding As.
6. the general creation method of dbus object according to claim 1, which is characterized in that the method is further wrapped It includes: the connection with system bus is established by dbus library function.
7. a kind of general creating device of dbus object, which is characterized in that described device includes:
At least one processor;With
Memory, the memory are stored with the program code that processor can be run, and said program code is run by processor Shi Zhihang following steps:
Creative management interface and object interface;
Image parameter is constructed, the image parameter includes the information of at least one dbus object;
Creation function is defined in the management interface, the input parameter of the creation function is the image parameter, the creation The output parameter of function is the dbus object;
In object interface addition by the dbus object of the creation function output;
The management interface and the object interface are called, the image parameter is inputted in the management interface, described right As interface creates at least one described dbus object.
8. the general creating device of dbus object according to claim 7, which is characterized in that the creation function is configured to The information of at least one dbus object is obtained according to the image parameter inputted, and is exported described dbus pairs corresponding As.
9. the general creating device of dbus object according to claim 7, which is characterized in that the information of the dbus object Title, the attribute of the dbus object and the value of the attribute including the dbus object.
10. the general creating device of dbus object according to claim 7, which is characterized in that the image parameter configuration To be constructed based on map dictionary, wherein the key key of dictionary is configured to the title of the dbus object, and the value value of dictionary is configured to The attribute of the dbus object and the value of the attribute.
CN201910628115.8A 2019-07-12 2019-07-12 A kind of general creation method and device of dbus object Withdrawn CN110413270A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910628115.8A CN110413270A (en) 2019-07-12 2019-07-12 A kind of general creation method and device of dbus object

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910628115.8A CN110413270A (en) 2019-07-12 2019-07-12 A kind of general creation method and device of dbus object

Publications (1)

Publication Number Publication Date
CN110413270A true CN110413270A (en) 2019-11-05

Family

ID=68361239

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910628115.8A Withdrawn CN110413270A (en) 2019-07-12 2019-07-12 A kind of general creation method and device of dbus object

Country Status (1)

Country Link
CN (1) CN110413270A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111277475A (en) * 2020-02-26 2020-06-12 杭州涂鸦信息技术有限公司 Cross-platform wireless interaction method and system based on blue z
CN112130900A (en) * 2020-08-21 2020-12-25 苏州浪潮智能科技有限公司 User information management method, system, equipment and medium for BMC

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111277475A (en) * 2020-02-26 2020-06-12 杭州涂鸦信息技术有限公司 Cross-platform wireless interaction method and system based on blue z
CN112130900A (en) * 2020-08-21 2020-12-25 苏州浪潮智能科技有限公司 User information management method, system, equipment and medium for BMC
CN112130900B (en) * 2020-08-21 2023-01-06 苏州浪潮智能科技有限公司 User information management method, system, equipment and medium for BMC

Similar Documents

Publication Publication Date Title
CN109684607B (en) JSON data analysis method and device, computer equipment and storage medium
CN111859470B (en) Business data chaining method and device
CN106778351B (en) Data desensitization method and device
US11269611B2 (en) Data interface processing method, device, server and medium
CN107479868B (en) Interface loading method, device and equipment
CN110162344B (en) Isolation current limiting method and device, computer equipment and readable storage medium
WO2020092135A1 (en) Extracting web api endpoint data from source code
CN110413270A (en) A kind of general creation method and device of dbus object
CN111414369A (en) Data processing method, device and equipment
CN112598321A (en) Risk prevention and control method, system and terminal equipment
CN109669678A (en) Template engine integration method, device, electronic equipment and storage medium
CN109582476B (en) Data processing method, device and system
CN108089895B (en) Activity registration method and device in plug-in, electronic equipment and storage medium
CN109345063B (en) Data processing method and device for wind control system and storage medium
CN116226921A (en) Desensitization processing method and device
CN114185623A (en) Method and device for processing deadlock in application starting process
CN111124399B (en) Processing method and device of popup assembly, storage medium and processor
CN114138507B (en) Python program service method, device and computer readable storage medium
US20180129517A1 (en) Performance acceleration in mixed-language applications
CN111274051B (en) Data processing method and device, electronic equipment and computer readable storage medium
CN113626005B (en) Block chain foundation contract development and deployment method, equipment and storage medium
CN113626011B (en) PHP architecture-based data request processing method, device and equipment
CN115391788A (en) Mobile terminal based on trusted execution environment and trusted application management method
CN105893092B (en) COM component processing method and device
CN117440000A (en) Parallel call interface method, device, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20191105

WW01 Invention patent application withdrawn after publication