CN103617091B - The implementation method and device of hardware resource dynamically distributes - Google Patents

The implementation method and device of hardware resource dynamically distributes Download PDF

Info

Publication number
CN103617091B
CN103617091B CN201310699757.XA CN201310699757A CN103617091B CN 103617091 B CN103617091 B CN 103617091B CN 201310699757 A CN201310699757 A CN 201310699757A CN 103617091 B CN103617091 B CN 103617091B
Authority
CN
China
Prior art keywords
hardware resource
application
hardware
application function
instruction
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
CN201310699757.XA
Other languages
Chinese (zh)
Other versions
CN103617091A (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.)
Autel Intelligent Technology Corp Ltd
Original Assignee
Autel Intelligent Technology Corp 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 Autel Intelligent Technology Corp Ltd filed Critical Autel Intelligent Technology Corp Ltd
Priority to CN201710531769.XA priority Critical patent/CN107291554A/en
Priority to CN201310699757.XA priority patent/CN103617091B/en
Publication of CN103617091A publication Critical patent/CN103617091A/en
Application granted granted Critical
Publication of CN103617091B publication Critical patent/CN103617091B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources

Landscapes

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

Abstract

The present invention is applied to the communications field, there is provided the implementation method and device of a kind of hardware resource dynamically distributes, methods described include:Receive during using instruction, an at least application function object is created according to application instruction;Create an at least hardware capability object of the application function object association;It is that the application function object distributes hardware resource according to the hardware capability object, performing the application by the hardware resource instructs.The method and device of the embodiment of the present invention can improve the real-time of embedded system.

Description

The implementation method and device of hardware resource dynamically distributes
Technical field
The invention belongs to the communications field, more particularly to a kind of hardware resource dynamically distributes implementation method and device.
Background technology
A class is embedded OS in currently a popular industrial computer design, and it is from operating in individual Operation system on computer is transplanted in embedded system downwards, the Windows of the embedded OS of formation, such as Microsoft CE and its new edition book WEC, SUN company JAVA operating systems, the Inferno of Lucent Technologies, built-in Linux etc., this Class system is tested by the longtime running of the product such as PC or high performance computer, and technology reaches its maturity, its correlation Standard and software development mode are generally received by user, while abundant developing instrument and application software resources is have accumulated, but Real-time is relatively low.Another kind of is real time operating system, such as the VxWorks of WindRiver companies, and pSOS, QNX system of ISI are soft The QNX of part company, this kind of product operation system structure and realize on all for towards application field, it is high to real-time can The design of exquisiteness, and standby system development and testing tool there is provided independent are carried out by property, more application is in military use product With the field such as Industry Control, but this system code amount, than larger, real-time is strong not enough.Embedded OS or in real time behaviour Had the following disadvantages as system:
﹒ high costs:Expensive copyright usage charges are needed mostly;
﹒ codes are huge:The minimum memory headroom for being also required to hundreds of more than KB, plants and cannot use in applying for small internal memory;
﹒ real-times are low:It is just real time operating system, is required for being spent required for the scheduling of execution task, memory management Time definitely than bare machine unite it is many, some specific functions cannot be realized in requirement of real-time application higher.
﹒ is larger using difficulty:Certain operating system development Experience is required for, to compare deep understanding system realizes machine System can realize driving the written in code of application.
The content of the invention
The purpose of the embodiment of the present invention is the implementation method and device for providing a kind of hardware resource dynamically distributes, it is intended to solved The low problem of certainly existing embedded system real-time.
The embodiment of the present invention is achieved in that a kind of implementation method of hardware resource dynamically distributes, and methods described includes:
Receive during using instruction, an at least application function object is created according to application instruction;
Create an at least hardware capability object of the application function object association;
It is that the application function object distributes hardware resource according to the hardware capability object, is performed by the hardware resource The application instruction.
Further, before an instruction establishment at least application function object according to application is performed, also include:
Judge whether to support that the application is instructed, be to perform described instruction according to application to create an at least application function pair As otherwise returning to failure.
Further, after performing the hardware resource and performing application instruction, also include:
Discharge the hardware resource.
Further, described is that application function object distribution hardware resource includes according to hardware capability object:
Idle hardware resource in retrieval facility manager;
The idle hardware resource retrieved described in initialization, completes the distribution of hardware resource.
Further, described is that application function object distribution hardware resource also includes according to hardware capability object:
When the application function object has multiple, correspondence is distributed to the multiple application function object by equipment manager Hardware resource.
The present invention also proposes a kind of device of hardware resource dynamically distributes, and described device includes:
First creation module, for receiving during using instruction, an at least application function pair is created according to application instruction As;
Second creation module, creates an at least hardware capability object of the application function object association;
Distribute module, for being that the application function object distributes hardware resource according to the hardware capability object, by institute State hardware resource and perform the application instruction.
Further, described device also includes:
Judge module, is to perform described instruction according to application to create extremely for judging whether to support that the application is instructed A few application function object, otherwise returns to failure.
Further, described device also includes:
Release module, for discharging the hardware resource.
Further, the distribute module includes:
Retrieval unit, for hardware resource idle in retrieval facility manager;
Initialization unit, for initializing the idle hardware resource for retrieving, completes the distribution of hardware resource.
Further, the distribute module also includes:
Select unit, for having multiple when the application function object, by equipment manager to the multiple application work( Can the corresponding hardware resource of object distribution.
In embodiments of the present invention, by the hardware resource in the presence of structure management system, and by device data Flag bit in structure, indicates whether oneself, through occupied, particular hardware resource is managed by using the concept of class to the hardware resource The need for realize concrete function;One equipment manager is built by using structure, with equipment manager, in maintenance system The hardware resource of all presence.Compared with prior art, in technical scheme proposed by the present invention, with following some advantage:
1. flexibility is high:Dynamic in fact hardware resource can be freely distributed, and can be in program module, any increase needs Applied function module, without changing device-dependent code.
3. real-time is high:The support of operating system, the autonomous distribution for completing hardware resource, efficiency of code execution are not needed Height, real-time is being improved greatly.
4. low cost:Due to not needing the support of operating system, the space that code needs is small, it is necessary to preserve code FLASH capacity requirements are not high.
5. smaller using difficulty:Without needing as operating system, it is necessary to familiar complicated system model, as long as repairing slightly Changing can just be applied in bare machine system.
Brief description of the drawings
Fig. 1 is the flow chart of the implementation method of the hardware resource dynamically distributes that the embodiment of the present invention one is provided;
Fig. 2 is the structure frame diagram in the implementation method of the hardware resource dynamically distributes that the embodiment of the present invention one is provided;
Fig. 3 is the structure chart for realizing device of the hardware resource dynamically distributes that the embodiment of the present invention two is provided;
Fig. 4 is the structure for realizing distribute module in device of the hardware resource dynamically distributes that the embodiment of the present invention two is provided Figure.
Specific embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
Embodiment one
Inventive embodiments one propose a kind of implementation method of hardware resource dynamically distributes.As shown in figure 1, the embodiment of the present invention One method includes:
Step S1, receive using instruction when, judge whether support application instruction, be then execution step S2, otherwise return lose Lose.
Step S2, an at least application function object is created according to application instruction, it is as shown in Figure 2 realize UART and SPI it Between data interaction functional object 5, realize between CAN and UART data interaction functional object 6 and realize between CAN and SPI Data interaction functional object 7.The embodiment of the present invention one is first carried out making code at the beginning of the overall situation, instantiates a USB class object pair Corresponding data is sent in instruction is received from PC or other equipment platforms, bulk circulation is then entered back into and is waited PC ends upper layer application Instruction, and according to one or more application function objects of corresponding Command Exampleization.
Step S3, at least hardware capability object for creating the application function object association, USB as shown in Figure 2 connect Data subobject 11, CAN is received and sends to receive and send the reception of data subobject 12, UART and send data subobject 13, SPI Data subobject 14, timer counter is received and sent according to device function subobject 15.
Step S4, according to the hardware capability object be the application function object distribute hardware resource, by the hardware Resource performs the application instruction.Hardware resource USB controller 21, timer conter 122, timer conter as shown in Figure 2 223rd, asynchronous serial communication interface 124, asynchronous serial communication interface 225, CAN BUS controllers 126, CAN BUS controllers 227th, SPI controller 128 and SPI controller 229.The hardware resource of particular hardware functional object and which entity in requisition for See the hardware resource that applied function module is distributed after building(Need distribution asynchronous as UART receives and send data subobject 13 Serial communication interface 124, asynchronous serial communication interface 225 are, it is necessary to know whether the hardware resource is occupied).Work as caller When functional module builds object factory structure applied function module, alloc_dev functions can be called, retrieve unused hardware money Source, and the type and ID of hardware resource are passed into applied function module, then it is delivered to the associated hardware of application function object Functional object, just the related register of the above-mentioned hardware resource of making and data structure, complete the distribution of hardware resource.
Step S5, the release hardware resource.When application function object is destructed, associated hardware work(is recalled Energy object carries out the release of hardware resource(Including impeding shutdown, a series of resources related to the hardware such as clock closing), so The free_dev power functions that caller functional module is built in factory afterwards complete the resource release of equipment manager(Will set Standby middle alloc_states indicates removing).Hardware resource so is distributed when each application function object builds, is being answered When release with functional object, occupancy of the release to hardware resource.Need to share when there are more than two application function objects When same type of hardware resource(Data interaction functional object 5 between such as UART and SPI, realize CAN and UART it Between data interaction functional object 6 be required for using UART controller)Just can complete logical to asynchronous serial according to equipment pipe and device Letter interface 124, asynchronous serial communication interface 225 are allocated.If also one applied function module also needs to use UART moneys Source, then when alloc_dev functions are called will fail, represent resource oneself take, only when before take hardware money This new applied function module could again after a certain application function object in source releases corresponding hardware resource It is assigned to hardware resource.
Wherein, related code section is as follows:
In the embodiment of the present invention one, by the hardware resource in the presence of structure management system, by using class The concrete function realized the need for concept management particular hardware resource;One equipment manager is built by using structure, is used Equipment manager, the hardware resource of all presence in maintenance system.Realization dynamically freely distributes hardware resource, and can be in program It is any to increase the applied function module for needing in module, without changing device-dependent code.And need not operate and be The support of system, the autonomous distribution for completing hardware resource, efficiency of code execution is high, and real-time is greatly improved.Due to that need not operate The support of system, the space that code needs is small, it is necessary to the FLASH capacity requirements for preserving code are not high.The nothing of the embodiment of the present invention one Need as operating system, it is necessary to familiar complicated system model, as long as change can just be applied in bare machine system slightly.
Embodiment two
The embodiment of the present invention two provides a kind of device of hardware resource dynamically distributes.As shown in figure 3, device of the invention can Including judge module 10, the first creation module 20, the second creation module 30, distribute module 40 and release module 50.Judge module 10 are used to receive during using instruction, judge whether to support that the application is instructed, and be, performing basis by the first creation module 20 should An at least application function object is created with instruction, failure is otherwise returned.First creation module 20, for being instructed according to the application Create an at least application function object.The data interaction functional object 5 realized between UART and SPI, realization as shown in Figure 2 Data interaction functional object 6 and data interaction functional object 7 between CAN and SPI is realized between CAN and UART.It is of the invention real Apply example one and making code at the beginning of the overall situation is first carried out, one USB class object of instantiation refers to for being received from PC or other equipment platforms Order sends corresponding data, then enters back into the instruction that bulk circulation waits PC ends upper layer application, and according to corresponding Command Example Change one or more application function objects.
Second creation module 30, creates an at least hardware capability object of the application function object association;As shown in Figure 2 USB receive and send data subobjects 11, CAN and receive and send that data subobject 12, UART is received and to send data right As 13, SPI receives and send data subobject 14, timer counter according to device function subobject 15.
Distribute module 40, for being that the application function object distributes hardware resource according to the hardware capability object, by The hardware resource performs the application instruction.It is hardware resource USB controller 21 as shown in Figure 2, timer conter 122, fixed Hour counter 223, asynchronous serial communication interface 124, asynchronous serial communication interface 225, the control of CAN BUS controllers 126, CANBUS Device processed 227, SPI controller 128 and SPI controller 229.Particular hardware functional object is corresponding to the hardware resource of which entity Need to see the hardware resource that applied function module is distributed after building(Distribution is needed as UART receives and send data subobject 13 Asynchronous serial communication interface 124, asynchronous serial communication interface 225 are, it is necessary to know whether the hardware resource is occupied).
Release module 50, for discharging the hardware resource.
As shown in figure 4, distribute module 40 further includes retrieval unit 41, initialization unit 42 and select unit 43.Inspection Cable elements 41 are used for hardware resource idle in retrieval facility manager;When structure applied function module is adjusted;Initialization unit 42, for initializing the idle hardware resource for retrieving, complete the distribution of hardware resource.Select unit 43, for working as The application function object has multiple, and distributing corresponding hardware to the multiple application function object by equipment manager provides Source.
In the device of the embodiment of the present invention two, by the hardware resource in the presence of structure management system, by using The concrete function realized the need for the concept management particular hardware resource of class;One equipment control is built by using structure Device, with equipment manager, the hardware resource of all presence in maintenance system.Realization dynamically freely distributes hardware resource, and energy It is any to increase the applied function module for needing in program module, without changing device-dependent code.And need not The support of operating system, the autonomous distribution for completing hardware resource, efficiency of code execution is high, and real-time is greatly improved.Due to being not required to The support of operating system is wanted, the space that code needs is small, it is necessary to the FLASH capacity requirements for preserving code are not high.The present invention is implemented Example one without needing as operating system, it is necessary to familiar complicated system model, as long as change can just be applied to bare machine system slightly In system.
Presently preferred embodiments of the present invention is the foregoing is only, is not intended to limit the invention, it is all in essence of the invention Any modification, equivalent and improvement made within god and principle etc., should be included within the scope of the present invention.

Claims (10)

1. a kind of implementation method of hardware resource dynamically distributes, it is characterised in that methods described includes:
Receive during using instruction, an at least application function object is created according to application instruction;The application function object bag Include realize between UART and SPI data interaction functional object, realize data interaction functional object and reality between CAN and UART Existing data interaction functional object between CAN and SPI;
Create an at least hardware capability object of the application function object association;
It is that the application function object distributes hardware resource according to the hardware capability object, is performed by the hardware resource described Using instruction;
One equipment manager is built by using structure, with the hardware of all presence in the equipment manager maintenance system Resource.
2. the method for claim 1, it is characterised in that described create at least according to application instruction and apply work(performing Before energy object, also include:
Judge whether to support that the application is instructed, be to perform described instruction according to application to create an at least application function object, Otherwise return to failure.
3. the method for claim 1, it is characterised in that after performing the hardware resource and performing application instruction, also Including:
Discharge the hardware resource.
4. method as claimed any one in claims 1 to 3, it is characterised in that described is application according to hardware capability object Functional object distribution hardware resource includes:
Idle hardware resource in retrieval facility manager;
The idle hardware resource retrieved described in initialization, completes the distribution of hardware resource.
5. method as claimed any one in claims 1 to 3, it is characterised in that described is application according to hardware capability object Functional object distribution hardware resource also includes:
When the application function object has multiple, correspondence is distributed to the multiple application function object by the equipment manager Hardware resource.
6. a kind of device of hardware resource dynamically distributes, it is characterised in that described device includes:
First creation module, for receiving during using instruction, an at least application function object is created according to application instruction;Institute Stating application function object includes the data interaction functional object realized between UART and SPI, realizes that data are handed between CAN and UART Mutual functional object and realize data interaction functional object between CAN and SPI;
Second creation module, creates an at least hardware capability object of the application function object association;
Distribute module, for being that the application function object distributes hardware resource according to the hardware capability object, by described hard Part resource performs the application instruction;
One equipment manager is built by using structure, with the hardware of all presence in the equipment manager maintenance system Resource.
7. device as claimed in claim 6, it is characterised in that described device also includes:
Judge module, is to perform described instruction according to application to create at least one for judging whether to support that the application is instructed Application function object, otherwise returns to failure.
8. device as claimed in claim 6, it is characterised in that described device also includes:
Release module, for discharging the hardware resource.
9. the device as any one of claim 6 to 8, it is characterised in that the distribute module includes:
Retrieval unit, for hardware resource idle in retrieval facility manager;
Initialization unit, for initializing the idle hardware resource for retrieving, completes the distribution of hardware resource.
10. the device as any one of claim 6 to 8, it is characterised in that the distribute module also includes:
Select unit, for having multiple when the application function object, by the equipment manager to the multiple application work( Can the corresponding hardware resource of object distribution.
CN201310699757.XA 2013-12-18 2013-12-18 The implementation method and device of hardware resource dynamically distributes Active CN103617091B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710531769.XA CN107291554A (en) 2013-12-18 2013-12-18 The implementation method and device of hardware resource dynamically distributes
CN201310699757.XA CN103617091B (en) 2013-12-18 2013-12-18 The implementation method and device of hardware resource dynamically distributes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310699757.XA CN103617091B (en) 2013-12-18 2013-12-18 The implementation method and device of hardware resource dynamically distributes

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN201710531769.XA Division CN107291554A (en) 2013-12-18 2013-12-18 The implementation method and device of hardware resource dynamically distributes

Publications (2)

Publication Number Publication Date
CN103617091A CN103617091A (en) 2014-03-05
CN103617091B true CN103617091B (en) 2017-06-16

Family

ID=50167794

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201310699757.XA Active CN103617091B (en) 2013-12-18 2013-12-18 The implementation method and device of hardware resource dynamically distributes
CN201710531769.XA Pending CN107291554A (en) 2013-12-18 2013-12-18 The implementation method and device of hardware resource dynamically distributes

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN201710531769.XA Pending CN107291554A (en) 2013-12-18 2013-12-18 The implementation method and device of hardware resource dynamically distributes

Country Status (1)

Country Link
CN (2) CN103617091B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015180111A1 (en) * 2014-05-29 2015-12-03 华为技术有限公司 Method, apparatus and device for managing system resource
CN109460296B (en) * 2018-10-23 2019-12-27 中科驭数(北京)科技有限公司 Resource allocation method and device of processor and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101071390A (en) * 2007-03-30 2007-11-14 腾讯科技(深圳)有限公司 Drawing resource management method and system
CN102246180A (en) * 2008-12-15 2011-11-16 国际商业机器公司 Method and system for impersonating a user
CN103136035A (en) * 2011-11-30 2013-06-05 国际商业机器公司 Method and device for thread management of hybrid threading mode program

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5802365A (en) * 1995-05-05 1998-09-01 Apple Computer, Inc. Dynamic device matching using driver candidate lists
US20050187924A1 (en) * 2004-02-20 2005-08-25 Microsoft Corporation Uniform resource discovery provider
US8001553B2 (en) * 2007-06-25 2011-08-16 Microsoft Corporation Aggregate computer system via coupling of computing machines
CN102129373A (en) * 2011-03-09 2011-07-20 湖南超视物联智能网络科技有限公司 Method based on internet-of-things terminal equipment driver software design framework

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101071390A (en) * 2007-03-30 2007-11-14 腾讯科技(深圳)有限公司 Drawing resource management method and system
CN102246180A (en) * 2008-12-15 2011-11-16 国际商业机器公司 Method and system for impersonating a user
CN103136035A (en) * 2011-11-30 2013-06-05 国际商业机器公司 Method and device for thread management of hybrid threading mode program

Also Published As

Publication number Publication date
CN103617091A (en) 2014-03-05
CN107291554A (en) 2017-10-24

Similar Documents

Publication Publication Date Title
Shiraz et al. Energy efficient computational offloading framework for mobile cloud computing
CN103064742B (en) A kind of automatic deployment system and method for hadoop cluster
CN102932408B (en) A kind of management method of server cluster and platform
US20180018197A1 (en) Virtual Machine Resource Allocation Method and Apparatus
CN111274033B (en) Resource deployment method, device, server and storage medium
CN104486234A (en) Method and server for uninstalling service exchanger to physical network card
KR20140061545A (en) Virtualized management method for hardware resources of communication device and relevant apparatus
CN107678752A (en) A kind of task processing method and device towards isomeric group
CN110502217B (en) ROS-based robot cloud platform design method
CN103716403A (en) SAAS application deployment method and system for PAAS platform under cloud computing environment
CN103885833A (en) Method and system for managing resources
KR102499705B1 (en) Method for detecting service of network and apparatus using the same
CN103414767A (en) Method and device for deploying application software on cloud computing platform
US20120144389A1 (en) Optimizing virtual image deployment for hardware architecture and resources
CN106897299A (en) A kind of data bank access method and device
KR20210105378A (en) How the programming platform's user code works and the platform, node, device, medium
CN117480494A (en) Coordinated container scheduling for improved resource allocation in virtual computing environments
CN103617091B (en) The implementation method and device of hardware resource dynamically distributes
US8977752B2 (en) Event-based dynamic resource provisioning
CN105095112A (en) Method and device for controlling caches to write and readable storage medium of non-volatile computer
CN105389196A (en) Method for processing seismic data by utilizing virtualization technology
CN114610440A (en) Method and system for constructing operating environment of simulator system
CN104991826A (en) Method and apparatus for deploying virtual machine
CN103853599B (en) A kind of extended method of node computing capability
CN114116487B (en) Pressure testing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent for invention or patent application
CB02 Change of applicant information

Address after: 518000 Guangdong city of Shenzhen province Nanshan District Xili Street Xueyuan Road No. 1001 Chi Park B1 building 7 layer, 8 layer, 10 layer

Applicant after: SHENZHEN AUTEL TECHNOLOGY CO., LTD.

Address before: 518000 Guangdong city of Shenzhen province Nanshan District Xili town tea light road on the south side of Shenzhen integrated circuit design and application of Industrial Park 106, 107, 109, 114

Applicant before: Shenzhen Autel Technology Co., Ltd.

GR01 Patent grant