(3) summary of the invention
The objective of the invention is: a kind of operation and development platform that is used for the virtual machine of embedded systemic software development as upper application software is provided, in the upper layer application some are realized in virtual machine as middleware than the general module of bottom, realize separating of upper layer application and platform feature, thereby simplify the design of the large-scale built-in system software in upper strata, improve software development efficiency; Strengthen the reliability and maintainability of upper layer software (applications) simultaneously.
A kind of virtual machine that is used for embedded systemic software development provided by the present invention, exploitation is provided and moves support based on a kind of bottom real time operating system each software module the large-scale embedded system in upper strata, it is characterized in that: it comprises data library device, the interprocess communication device, high reliability devices, debugging apparatus, task scheduling apparatus, the Extended Protocol device, clock apparatus, communicator between memory management device and multitask, wherein: data library device, storage platform as business datum, quasistatic data form in the storage embedded system, storage has real-time, the data of distributivity characteristics, utilize socket to realize the distributed communication function, in addition, the physical location for data is transparent during each software module visit data of described embedded system; The interprocess communication device, as the message route platform, for each software module of described embedded system provides transparent message communicating mechanism, that is: the input parameter when sending message according to the software module of embedded system in the call function, judge that this message sends to local task or far-end task, if local task then call operation system function directly sends message, if the far-end task is then by specific task identification rule, the purpose processor that arrives of decision message at first, decision receives the specific tasks of message again, simultaneously because the message that the software module of all embedded systems sends and receives is all passed through the interprocess communication device, so it can also be after equipment development be finished normally operation, the message tracking function that does not utilize debugging code is provided, the management interface that the user can provide by the Operation and Maintenance agent software, the particular message in the mailbox in the communicator between trace daemon; High reliability devices, reliability management tool software based on business-like bottom hardware level, as middleware platform, making the high reliability that provides professional on the application level become may and can realize, that is: the event detection of the management object of each software module of support embedded system and corresponding processing, relate to the data sync between application and the recovery of application, be used for the transmission and the reception of the checkpoint of Restoration Mechanism, finish corresponding action and system topological is safeguarded by the mode of readjustment; Debugging apparatus, debug function to each software module of described embedded system is provided, be used for the error diagnosis of the development phase or the operation phase of software module, that is: according to exploitation commissioning staff's input parameter, it can export the state of certain task in certain software module in the embedded system, the content of certain message, the value of certain variable, the data of certain section memory address storage, in addition, the realization of this debugging apparatus needs the support of Operation and Maintenance software; Task scheduling apparatus, be used for dispatching the related and software module that need not several embedded systems of seizing in advance each other of described embedded system, finish the scheduling of the software module of embedded system, this task scheduling apparatus replaces scheduling that described operating system finishes software module and communicates by letter, and this device and the software module that is scheduled are together as a task on the operating system in form; The Extended Protocol device is realized communication protocol, and according to the needs that each software module of described embedded system is used, realizes the specific basic communication protocol of this application need; Clock apparatus has encapsulated the time management function of the described real time operating system of bottom, and the clock synchronization function that the clock control circuit plate provides in the sealed in unit, on unified interface is provided; The memory management device, the memory management that is different from described real time operating system mechanism is provided, the main next program code stored and intermediate data of preallocated static memory that uses, by to built-in concordance list, the management of pointer chained list, the memory management device provides memory management function to each software module of embedded system, comprises Memory Allocation and release, core buffer is reserved the unit, and provides certain memory overflow to detect automatically and reclaim; Communicator between multitask, be used to coordinate between multitask synchronous, that is: extract out some general character that a plurality of described real time operating systems provide message communication mode and encapsulated, to on unified application programming interface is provided, this application programming interface is the subclass that the real time operating system that adopts is supported.
The above-mentioned virtual machine that is used for embedded systemic software development, wherein, data library device is taked network data model, the perhaps direct real-time embedded database software module of integrated specialized commercialization.
The above-mentioned virtual machine that is used for embedded systemic software development, wherein, task scheduling apparatus comprises scheduling sublayer device, message pond device, the sub-device of upper layer application interface, the sub-device of operating system interface and the sub-device of application registry, and wherein: scheduling sublayer device, the sub-device of application registry and message pond device are connected between sub-device of upper layer application interface and the sub-device of operating system interface: the sub-device of upper layer application interface links to each other with the sub-device of operating system interface; The scheduling sublayer device links to each other with message pond device with the sub-device of application registry respectively.
By the present invention, for the large-scale built-in system software in upper strata provides a powerful operation and development platform, not only shielded the details of underlying operating system, realized the levels independence, increased the portability of upper layer application code, and what is more important: by in virtual machine, comprising the middleware component of versatility, concentrated the transferring in this virtual machine of the function of some general modules in the upper application software realized, hierarchical structure is clear, realized separating of upper layer application and platform feature, thinking more is absorbed in the realization of concrete function and business and needn't be concerned about in the relevant details of platform when making the design upper layer software (applications), thereby effective simplification the design of the large-scale built-in system software in upper strata, improve software development efficiency, simultaneously, also strengthened the reliability and maintainability of upper layer software (applications).
(5) embodiment
As Fig. 1, virtual machine of the present invention (VM) device 2 runs on the real time operating system 3, provides service to the built-in system software 1 on upper strata, not only as the operation platform of built-in system software 1, but also as its development platform.Virtual machine 2 is developed on real time operating system 3, and the developing instrument of use is Tornado (a kind of Integrated Development Environment based on VxWorks).Hardware 5 is a complete NodeB (base station) systems, block system control single-deck and polylith business processing single-deck have been comprised, a MPC860 (a kind of processor chips that U.S. Motorola Inc. produces) processor is all arranged on each single-deck, link to each other by industrial bus between the single-deck, can real time interaction information.On single-deck, plate support package and device driver 4 are arranged.Real time operating system 3 adopts Vxworks (present a kind of main flow embedded real-time operating system), built-in system software 1 comprises master control, Iub (interface in the WCDMA network between radio network controller and base station) interface control signaling, application modules such as Operation and Maintenance.
The external interface of virtual machine (VM) device 2 is as follows:
As Fig. 1, on the interface between built-in system software 1 and the virtual machine 2, provide four types API (application programming interface) on 2 pairs of the virtual machines, from left to right: the function call of no rreturn value, the function call that rreturn value is arranged, Hook Function, message informing.Need to prove: the rreturn value of the function that is called is not represented the result of the function that is called, whether no number-theoretic function has rreturn value, after the function that is called returns, returning of result is divided into two kinds of situations: return (finished all processing procedures when function returns, result is returned immediately) immediately; Do not return (processing procedure of this function call was not finished when function returned, and result can not be returned immediately, returned after needing to wait for certain hour again) immediately.The realization mechanism of Hook Function is as follows: at first by built-in system software 1 to virtual machine 2 registration Hook Function addresses, when particular event that should Hook Function is taken place, call Hook Function in the built-in system software 1 automatically by virtual machine 2.Message informing has three kinds of modes: N, synchronization notice, asynchronous notifications etc.Synchronization notice means returns result in the process of implementation, is generally once, and asynchronous notifications means report message in the process of implementation, and may report repeatedly.Interface between virtual machine 2 and the real time operating system 3 does not mark in detail, realizes because this interface belongs to inner, and the main and real time operating system 3 of its details is closely related, and is also relevant with hardware 5 with plate support package and device driver 4 in addition.Virtual machine 2 has shielded the details of this interface, and this interface is sightless to the built-in system software 1 on upper strata.
As Fig. 1, virtual machine has nine module: DB (database) device 21 for 2 li, IPC (interprocess communication) device 22, HA (high reliability) device 23, Debug (debugging) device 24, task scheduling apparatus 25, Extended Protocol device 26, clock apparatus 27, memory management device 28, communicator 29 between multitask.Specific implementation brief description to each device is as follows:
DB (database) device 21: as the storage platform of business datum, the quasistatic data form in the storage system, the data of storage have real-time, distributivity characteristics.Real-time is embodied in issued transaction regularly restriction, require to finish in a certain particular moment or regular hour, and data is closely related with the time, and Data Update is very fast, and the existence of data has timeliness, and out-of-date data are possible meaningless.Distributivity is embodied in actual data and may be stored on one or more physical equipments, but these data are by keeping consistency synchronously, and DB (database) device is realized the distributed communication function by the socket based on TCP/IP (transmission control protocol/IP(Internet Protocol)).Physical location for data during the built-in system software visit data on upper strata is transparent.DB (database) device 21 has two kinds of implementations, first kind is independently developed, accord with SQL (Structured Query Language (SQL)) standard, support data definition, maintenance and management, support transaction management and operation, support the multi-user, for satisfying higher real-time requirement, this DB (database) mainly takes network data model, by the index field of multi-to-multi, but fast query and visit data, the data storage method of kernel still adopts traditional data structure, comprises array, a small amount of chained list and Hash (Hash table), distributed function is supported the communication between the different processor, guarantees the consistance of data; Second kind of scheme is the direct real-time embedded database software of integrated specialized commercialization, these softwares have generally all been considered to match with specific real time operating system, real-time is good, stable and reliable for performance, for unified API (application programming interface) upwards is provided, need carry out simple package to the API that the real-time embedded database software of commercialization provides.The efficient of first kind of scheme is higher.
IPC (interprocess communication) device 22: as the message route platform, for the software module in the large-scale embedded system 1 in upper strata provides transparent message communicating mechanism.Input parameter when sending message in the upper layer software (applications) 1 in the call function, judge that this message sends to local task or far-end task, if local task then call operation system function directly sends message, if the far-end task is then by specific task identification rule, the purpose processor that arrives of decision message at first, decision receives the specific tasks of message again, the built-in system software on upper strata just is not concerned about complicated message route like this, need simply call the unified API (application programming interface) that IPC (interprocess communication) device provides.Simultaneously because the message that all upper layer software (applications) modules send and receive is all passed through IPC (interprocess communication) device, so it can also be after equipment development be finished normally operation, the message tracking function that does not utilize debugging code is provided, the management interface that the user can provide by the Operation and Maintenance agent software is followed the tracks of the particular message in the mailbox in IPC (interprocess communication) device.Adopt self-defining communication protocol, realize the route of the inside story between the different task in the built-in system software 1.Three parameters relevant with route are GID (overall identification) among IPC (interprocess communication) device 22 API that upwards provide (application programming interface), Operation Code (operation code) and Instance ID (instance identification), wherein preceding two parameters are necessary, and last parameter is optional.GID is used for specifying unique processor, two kinds of forms are arranged: functive sign and processor number sign, but the functive sign can be mapped to processor flag, OperationCode (operation code) is used for the some Task (task) on the given processor, Instance ID (instance identification) is used for specifying some user's data lists (or context) of Task (task) processing, because some task is public, not at a specific user, so needn't assigned I nstance ID (instance identification) when these tasks send message.IPC (interprocess communication) device 22 is distributed on all processors, sending the message end, when the built-in system software 1 on upper strata will send message, it was indifferent to the entity of reception message on which processor of system, only need call the API (application programming interface) of following form:
VmMsgSend(int?GID,int?OperationCode,int?InstanceID,char*innerMsgBuffer)
Wherein function parameter innerMsgBuffer comprises the inside story that is used for intermodule communication of system definition, being implemented in IPC (application programming interface) device 22 of this function, the IPC of transmitting terminal (application programming interface) device 22 will at first judge that according to GID whether the message destination is at this processor, then directly call the system API that real time operating system 3 provides in this way, send message, if not, then seek the purpose processor according to GID (overall identification), GID (overall identification) can will be mapped to IP (the internetwork communication agreement of bottom, be widely used in current internet) address or other protocol addresss, like this according to GID (overall identification), comprise Operation Code, the extended message bag of Instance ID will be sent to IPC (application programming interface) device 22 on the purpose processor, this IPC device 22 searches out concrete task according to OperationCode then, searches out concrete user's context according to InstanceID.Another critical function of IPC (application programming interface) device 22 is the tracking that realizes the message in the normal equipment that moves, these message Tracking Realization means are different from passing through in the software development phase and open the means that the compiler toggle option realizes that message is followed the tracks of, it is not that execution by debugging code realizes that the message of IPC (application programming interface) device 22 is followed the tracks of, because do not had debugging code in the commencement of commercial operation software of this moment, but by with the privately owned interface of Agent (agency) module, and utilize the external interface of Agent to realize, the input parameter that message is followed the tracks of is only relevant with the software module that needs are followed the tracks of, and it is irrelevant with the circuit board at software module place, that is to say for the same software module on the various boards, the input parameter that message is followed the tracks of is the same, and inner realization is also identical.
HA (high reliability) device 23: based on the reliability management tool software of business-like bottom hardware level, as the middleware platform of high reliability, making the high reliability that provides professional on the application level become may also realize than being easier to.Support the event detection and corresponding processing of the management object of application layer, relate to the data sync between application and the recovery of application, transmission and the reception of Checkpoint (checkpoint is used for Restoration Mechanism), finish corresponding HA (high reliability) action, system topological maintenance etc. by the mode of readjustment.The HA of the built-in system software on upper strata adds 1 by important disposable plates is carried out 1, N adds 1 or 0/1 backup realization, 1 adds 1 backup is meant that a processor is in Active (activation) attitude, another is in Standby (standby) attitude, when the Active plank makes a mistake can not normally move the time, Standby (standby) plank is taken over the work of Active (activation) plank, and become Active (activation) plank attitude, Active originally (activation) plank is through failure recovery, enters Standby (standby) state after normal.N adds 1 backup and is meant that N processor is in Active (activation) attitude, have only one to be in Standby (standby) attitude, two planks all are in Active (activation) state during 0/1 backup, but have only the result of a plank using, when making a mistake for one, use the result of another plank by change-over switch, detection, switching judging and work maintenances etc. of these backup plate running statuses are all finished by HA device 23.HA device 23 has called the commercial HA platform of bottom, this platform belongs to redundant system groove high reliability CompactPCI (a kind of bus standard) system, by the requirement (99.999%) that provides redundancy to satisfy system's high reliability for the assembly that activates, but being detection, notice and some basic HA (high reliability) hardware capabilities of the mistake of platform hardware equipment, the emphasis of its concern (as provides that 100M ether is connected between active and standby master control borad, the purpose that is used for data sync) etc., and for detection wrong in the application program, do not provide support.HA (high reliability) device 23 has been realized relevant with HA (high reliability), be similar to the function that the management middleware is finished, incident management as data synchronization, application level between using, Checkpoint (checkpoint, be used for Restoration Mechanism) transmission and reception, finish corresponding HA action, system topological maintenance etc. by the mode of readjustment.The built-in system software 1 on upper strata is as long as by HA (high reliability) the device 23 better simply interfaces that provide, just can obtain HA_Aware (high reliability consciously).
Debug (debugging) device 24: the debug function to the upper strata built-in system software is provided, is used for the development phase of software or the diagnosis of operation phase gross mistake etc.Input parameter according to the exploitation commissioning staff, Debug (debugging) device can be exported in the built-in system software of upper strata the state of certain task in certain module, the content of certain message, the value of certain variable, the data of certain section memory address storage etc., the developer need be familiar to the upper layer software (applications) of debugging.Debug (debugging) device comprises that to all upper strata built-in system softwares the protocol software, Operation and Maintenance software etc. provide debugging, follows the tracks of the primitive message between different task in the built-in system software 1, interface message, error message etc.Debug (debugging) installs 24 other devices that are relatively independent of in the system, before beginning tracking, Buffer (Buffer Pool) information of communication between different software intermodule and embedded system 1 and the virtual machine 2 in Debug (debugging) the device 24 needs acquisition built-in system softwares 1, the loading and the internal memory relocation information of 24 pairs of whole software systems of Debug (debugging) device also must be clear, need the support of Operation and Maintenance software.Typical primitive message tracing function is as follows:
PmTrace(char*filename,int?line,int?interface,char*module?name,char*function_name,int?datatype,char*outaddress,int?outlength)
Wherein, filename is the software source code filename, and line is a line number, interface is the sign interface, module_name is a module name, and function_name is a function name, and datatype is a data type, as integer, structure, array, byte etc., outaddress deposits the OPADD of Debugging message, and outlength is the length of Debugging message.And last three parameter d atatype, outaddress, outlength can repeat repeatedly as one group, mostly are most 10 times.
After calling this function, reading the information of the long byte number of outlength in the outaddress address, is exactly message content.
Task scheduling apparatus 25: as shown in Figure 2, this device is inner to be made up of scheduling sublayer device 251, message pond device 252, the sub-device 253 of upper layer application interface, the sub-device 254 of operating system interface, the sub-device 255 of application registry etc., be used for a plurality of upper layer application devices of dispatching built-in system software 1 system relationship degree height and need not each other to seize in advance, finish the scheduling of upper layer application device.This device replaces scheduling that operating system finishes application software module and communicates by letter, and this device and the upper application module that is scheduled are together as a task on the operating system in form.Wherein, scheduling sublayer device 251 carries out the scheduling controlling of upper strata built-in system software 1 according to the sign of the application of the purpose of the message in the message pond device 252 sign and registration, and scheduling strategy is provided.Message pond device 252, the message that intermodule interactive messages in the storage built-in system software 1 and peripheral applications task module mail to module in the built-in system software 1 is carried out the Access Control of message pool.The sub-device 253 of upper layer application interface receives the message send request of upper strata built-in system software 1, judges the purpose and the route that send message, and the activation of upper strata built-in system software 1 is to the upper strata built-in system software 1 pond access capability that gives information.The sub-device 254 of operating system interface is finished from the message sink of real time operating system 3, and message inspection, format conversion, message stores are accepted external message and sent request, and format conversion, message send.The sub-device 254 of application registry, public informations such as the sign of module, message processing function inlet in the built-in system software 1 of storage upper strata.When certain the upper application module desire in the built-in system software 1 sends message, activate upper layer application interface arrangement 253, upper layer application interface arrangement 253 will judge whether the purpose of message is another upper application module that is scheduled simultaneously, if, to send the message stores request to message pool device 252 and finish message stores, otherwise, solicit operation SIU system interface unit 254 is sent a message to other peripheral tasks, operating system interface device 254 conversion of inside story form and PERCOM peripheral communication form of column criterion of going forward side by side that is activated, and send to real time operating system 3 request messages.When receiving message in the message queue of real time operating system 3, operating system interface device 254 is activated and carries out the message purpose and judge, purpose sign as message is consistent with certain application identities in the application registry device 255, just will accept message conversion and be the inside story form of standard and carry out message stores, otherwise send alarm to 252 message stores requests of message pool device.Scheduling sublayer device 251 is constantly read message from message pond device 252, determine to call function in certain upper application module according to the information that obtains in the purpose of message sign and the application registry device 255.By the use of task scheduling apparatus 25, the task that solved in traditional embedded system on the operating system is too much, and the scheduling burden is heavy, and the problem that efficient is not high simultaneously, makes upper strata built-in system software 1 needn't be concerned about the details of scheduling.
Extended Protocol device 26: according to the needs of the built-in system software 1 on upper strata, some communication protocols than bottom are implemented in 2 li of virtual machines, upper layer application only needs simple calling interface function like this, but with regard to use agreement, has simplified the design objective on upper strata.Virtual machine has encapsulated TCP/IP (transmission control protocol/IP(Internet Protocol)) for 2 li at present, SNMP (Simple Network Management Protocol), ftp (file transfer protocol (FTP)), RLC (radio link control), MAC (media access control protocol) etc., wherein some agreement is that the development environment of real time operating system 3 provides, some is the commercial middleware of purchasing in addition, some is independently developed, and the built-in system software 1 for the upper strata all can directly use.
Clock apparatus 27: encapsulated management function basic time of the real time operating system of bottom, and the clock synchronization function that the clock control circuit plate provides in the sealed in unit, to the unified interface of last confession.Basic time management function has been the simple package Clock management of real time operating system 3, the clock synchronization function package function of clock control plate of bottom, make to keep synchronously between disparate modules in the built-in system software 1 on upper strata, and keep clock synchronization with the extranets guard system.
Memory management device 28: the memory management that is different from bottom real time operating system mechanism is provided.For efficient and the reliability that improves built-in system software 1, forbidden the dynamic memory management function that real time operating system 3 provides, the basic static memory operating strategy that memory management device 28 has only adopted real time operating system 3 to provide downwards, but pass through built-in concordance list, the management of pointer chained list, 28 pairs of built-in system softwares 1 of memory management device provide flexibly and memory management function efficiently, comprise obtaining and discharge of internal memory, the reservation unit of core buffer when being used for protocol communication, and provide certain internal memory to reveal detection and recovery technology automatically.
Communicator 29 between multitask: be used to coordinate between multitask synchronous.The message of some general character that abstract a plurality of real time operating system provides comprises incident, signal lamp; mutex; communication modes such as territory protection and being encapsulated, on unified interface is provided, this application programming interface is the subclass that real time operating system that bottom adopts is supported.Extract a plurality of real time operating systems in message, incident, signal lamp, shared drive, the common feature of aspects such as territory protection mechanism, after the simplified package on unified application programming interface is provided, this interface is the subclass that the real time operating system that herein adopts 3 is supported.
Developed the upper application software of WCDMA NodeB (wide-band CDMA base station) based on the present invention, the result shows: the design of this virtual machine energy effective simplification upper application software, improve the reliability and maintainability of application system, method has than before reduced by 30% design effort amount, it is nearly 50% that lines of code has subtracted suddenly, and find in the test that total software error number has also descended 30%.