Background technology
Because the address space difference of various computing machine system, therefore the indicating pointer cell of an internal system can't be discerned in another system.This problem is perplexing the actual use of ATE (Adaptive Test Equipment, automated test tool), and the message of background system (windows platform) structure has arrived location inexplainably, foreground (vxWorks platform) owing to containing indicating pointer cell.In fact, every when the interdepartmental system transmission of needs wherein contains the message of pointer, all can run into this problem.For example, carrying out unit testing, perhaps integration testing need be constructed test case (case), and the machine of transmission message and measured body will face this problem not on same machine.
Wherein, Fig. 1 has provided the message structure that has indicating pointer cell.
At present, addressing this problem mainly is to be undertaken by following two kinds of approach, and a kind of method is to adopt the ANS.1 decoding method, and another kind of method is a kind of data structure that does not have pointer type of definition.
Wherein, decoding method can make that running efficiency of system is lower, takies the buffering area of system and increases cpu load, thereby have influence on the operational efficiency of whole system, in addition, different message structures uses different encoding and decoding programs, so the programming more complicated.A kind ofly do not have the method for the data structure of pointer to be applicable to fairly simple message transmission and define, for having the nested complex message structure of a large amount of pointers in the communication system, adopt this kind processing method can be very complicated.
Therefore, for the message problem of transmission of the band indicating pointer cell of crossing over address space, need solve by a kind of method that can be convenient to realize and can not influence running efficiency of system.
Summary of the invention
Consider the problems referred to above and make the present invention that for this reason, the present invention aims to provide a kind of transmission scheme of the message with indicating pointer cell.
According to embodiments of the invention, a kind of transmission method of the message with indicating pointer cell is provided, comprise following processing: step S202, calculate the sub-message number in the message of being with indicating pointer cell, and constructor message arrangement information table, wherein, the configuration information in the sub-message arrangement information table comprises: father's message id, sub-message id, sub-message address offset, the sub-message data length in father's message; Step S204 will be with the message and the sub-message arrangement information table of indicating pointer cell to be packaged together, and sends to the receiver address space; Step S206, after the receiver address space receives the message of band indicating pointer cell, applied address space, and the receiver address space memory address of the root node of the message of record paper indicating pointer cell; Step S208, the receiver address space is inserted message id and address space correspondence table by calculating with the receiver address space memory address of father's message id and sub-message id correspondence; And step S210, call translater according to the configuration information in the sub-message arrangement information table and finish from sending the address translation process of address space to the receiver address space.
Wherein, in the message of band indicating pointer cell, the structure at pointer place is father's message, and the structure of pointer indication is sub-message, and by all father's message and sub-message numbering in the message of band indicating pointer cell are generated father's message id and sub-message id.
As for message id and address space correspondence table, it is used for storing correspondingly the receiver address space memory address of father's message id/sub-message id correspondence.
In step S208, the receiver address space according to root node receiver address space memory address and sub-message the address offset information in father's message calculate.
In step S210, translation process is specially: by reading sub-message arrangement information table and message id and address space correspondence table, translater obtains the memory address of father's message in the receiver address space according to father's message id of sub-message; The memory address that obtains is added the address offset of sub-message in father's message, obtain pointing in father's message the pointer of sub-message; Sub-message is composed to pointer at the memory address in receiver address space, thereby finished address transition.
After described step S210, send address space and can send to other receiver address spaces once more with being with the message and the sub-message arrangement information table of indicating pointer cell to be packaged together.
According to embodiments of the invention, a kind of transmission system of the message with indicating pointer cell also is provided, comprise: first constructing module, be positioned at transmission address space side, be used for constructing the sub-message arrangement information table that carries following configuration information: father's message id, sub-message id, sub-message are in the address offset of father's message, sub-message data length; The package module is positioned at transmission address space side, is used for being with the message and the sub-message arrangement information table of indicating pointer cell to be packaged together, and sends to the receiver address space; Address space application module is positioned at receiver address space side, after the message that receives the band indicating pointer cell, and the root node memory address of the message of applied address space and record paper indicating pointer cell; Second constructing module is used to construct message id and address space correspondence table, and wherein, message id and address space correspondence table are used for storing correspondingly father's message id/sub-message id and corresponding receiver address space memory address thereof; Computing module is positioned at receiver address space side, is used to calculate the receiver address space memory address of father's message id and sub-message id correspondence, and result of calculation is inserted message id and address space correspondence table; Translater is positioned at receiver address space side, is used for finishing from sending the address translation process of address space to the receiver address space according to the configuration information of sub-message arrangement information table.
Wherein, translater comes to obtain the memory address of father's message in the receiver address space according to father's message id of sub-message by reading sub-message arrangement information table and message id and address space correspondence table; And translater adds the address offset of sub-message in father's message by the memory address that will obtain, and obtains pointing in father's message the pointer of sub-message; After this, translater is composed sub-message to pointer at the memory address in receiver address space, thereby finishes address transition.
By technical scheme of the present invention, can be in the message of different address space conveyer belt indicating pointer cells, simplified the processing procedure of communication system, particularly: the package of technical scheme of the present invention, the process that unpacks have versatility, need be at different message constructing not different packages, unpack program; Message after unpacking can continue to pass to the next address space again, only needs a package, does not need double counting, and therefore required amount of calculation is few, and fewer for calculating the additional information sign that adds.
Embodiment
In an embodiment of the present invention, a kind of transmission scheme of the message with indicating pointer cell is provided, it is applicable to the situation in the message of different address space conveyer belt indicating pointer cells (pointer structure), the message that is particularly useful in the mobile communication system not only has pointer, and have the situation of a large amount of nested pointers, for example, between windows platform, between the vxWorks platform, and the situation that transmits the message that has indicating pointer cell between the different platform.
Describe embodiments of the invention in detail hereinafter with reference to accompanying drawing, provide following embodiment with provide to of the present invention comprehensively and thorough, rather than the present invention carried out any restriction.
In the following description, the structure of pointer indication is used as sub-message, the structure at pointer place is used as father's message, and write down this set membership.And hypothesis sends the message of band indicating pointer cell to address space B (receiver address space) from address space A (transmission address space).
Method embodiment
A kind of transmission method of the message with indicating pointer cell is provided in this embodiment.
As shown in Figure 2, this method may further comprise the steps:
Step S202, calculate the sub-message number in the message of being with indicating pointer cell, and constructor message arrangement information table (table 1), wherein, the configuration information in the sub-message arrangement information table comprises: father's message id, sub-message id, sub-message address offset, the sub-message data length in father's message; Wherein, can be by all father's message and sub-message numbering in the message of band indicating pointer cell be generated father's message id and sub-message id;
For example, the structure of sub-message arrangement information table can be for as follows:
Table 1
Father's message id |
Sub-message id |
The address offset of sub-message in father's message |
Sub-message data length |
xxxx |
xxxx |
xxxx |
xxxx |
Step S204 will be with the message and the sub-message arrangement information table of indicating pointer cell to be packaged together (package process), and sends to the receiver address space;
After step S206, receiver address space (address space B) receive the message of band indicating pointer cell, applied address space, and the receiver address space memory address of the root node of the message of record paper indicating pointer cell;
Step S208, the receiver address space is inserted message id and address space correspondence table (table 2) by calculating with the receiver address space memory address of father's message id and sub-message id correspondence;
Particularly, root node receiver address space memory address that receiver address space basis writes down in step S206 and the sub-message address offset information (obtaining by inquiring about sub-message arrangement information table) in father's message is calculated, with root node (for example, father's message 1 among Fig. 1) memory address adds address offset, (for example obtain the ground floor child node, sub-message 2 among Fig. 1) memory address similarly, can calculate the memory address of follow-up sub-message;
Wherein, message id and address space correspondence table are used for storing correspondingly the receiver address space memory address of father's message id/sub-message id correspondence, and for example, its structure can be for as follows:
Table 2
A space message id |
B space memory address |
xxxx |
xxxx |
Step S210 calls translater according to the configuration information in the sub-message arrangement information table and finishes from sending the address translation process (separate packet procedures) of address space to the receiver address space.
Above-mentioned translation process is specially: by reading sub-message arrangement information table and message id and address space correspondence table, translater obtains the memory address of father's message in the receiver address space according to father's message id of sub-message; The memory address that obtains is added the address offset of sub-message in father's message, obtain pointing in father's message the pointer of sub-message; Then, sub-message is composed to pointer at the memory address in receiver address space, thereby finished address transition.
For example, for the sub-message 2 among Fig. 1, from sub-message arrangement information table, obtain the ID of his father's message 1, ID according to father's message 1 obtains the memory address of father's message 1 at address space B from message id and address space correspondence table again, then, obtains the address offset of sub-message 2 in father's message 1 from sub-message arrangement information table, obtain pointing in father's message 1 pointer of sub-message 2, at last, sub-message 2 is composed to pointer at the memory address of address space B, thereby finished the address transition of sub-message 2.
After the receiver address space unpacks message, need to send to other receiver address spaces if send address space with the message of indicating pointer cell, a need gets final product this message and sub-message arrangement information table thereof package again once more, and does not need double counting.
As shown in Figure 3, can the receiving course of the message of above-mentioned band indicating pointer cell be described as follows: receive message; Judged whether the pointer node,, carried out normal flow,, then carried out the above-mentioned flow process of present embodiment if having if do not have; Obtain the configuration information of all sub-message from sub-message arrangement information table, generate message id and address space correspondence table; Call translater and finish address translation work.
Device embodiment
A kind of transmission system of the message with indicating pointer cell is provided in this embodiment.As shown in Figure 4, comprise: first constructing module 402, be positioned at transmission address space side, be used for constructing the sub-message arrangement information table that carries following configuration information: father's message id, sub-message id, sub-message are in the address offset of father's message, sub-message data length; Package module 404 is positioned at transmission address space side, is used for being with the message and the sub-message arrangement information table of indicating pointer cell to be packaged together, and sends to the receiver address space; Address space application module 406 is positioned at receiver address space side, after the message that receives the band indicating pointer cell, and the root node memory address of the message of applied address space and record paper indicating pointer cell; Second constructing module 408 is used to construct message id and address space correspondence table, and wherein, message id and address space correspondence table are used for storing correspondingly father's message id/sub-message id and corresponding receiver address space memory address thereof; Computing module 410 is positioned at receiver address space side, is used to calculate the receiver address space memory address of father's message id and sub-message id correspondence, and result of calculation is inserted message id and address space correspondence table; Translater 412 is positioned at receiver address space side, is used for finishing from sending the address translation process of address space to the receiver address space according to the configuration information of sub-message arrangement information table.
Wherein, translater 412 comes to obtain the memory address of father's message in the receiver address space according to father's message id of sub-message by reading sub-message arrangement information table and message id and address space correspondence table; And translater 412 adds the address offset of sub-message in father's message by the memory address that will obtain, and obtains pointing in father's message the pointer of sub-message; After this, translater 412 is composed sub-message to pointer at the memory address in receiver address space, thereby finishes address transition.
Need to prove that the specific detail of describing among the method embodiment is equally applicable to this system embodiment, make the present invention unclear, omitted being repeated in this description same or similar part for unnecessary.
As mentioned above, the package of technical scheme of the present invention, the process that unpacks have versatility, need be at different message constructing not different packages, unpack program; Message after unpacking can continue to pass to the next address space again, only needs a package, does not need double counting, and therefore required amount of calculation is few, and fewer for calculating the additional information sign that adds.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.