CN105511910A - Interface configuration method and device - Google Patents

Interface configuration method and device Download PDF

Info

Publication number
CN105511910A
CN105511910A CN201510854114.7A CN201510854114A CN105511910A CN 105511910 A CN105511910 A CN 105511910A CN 201510854114 A CN201510854114 A CN 201510854114A CN 105511910 A CN105511910 A CN 105511910A
Authority
CN
China
Prior art keywords
configuration
configuration parameter
message information
variable
message
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.)
Pending
Application number
CN201510854114.7A
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.)
Beijing Electric Vehicle Co Ltd
Original Assignee
Beijing Electric Vehicle 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 Beijing Electric Vehicle Co Ltd filed Critical Beijing Electric Vehicle Co Ltd
Priority to CN201510854114.7A priority Critical patent/CN105511910A/en
Publication of CN105511910A publication Critical patent/CN105511910A/en
Pending legal-status Critical Current

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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming

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)

Abstract

The invention provides an interface configuration method and device. The interface configuration method comprises that a message is obtained from a source file, configuration parameters in the message are analyzed, the configuration parameters are processed in dependence on a predefined format to generate a configuration message, and then the configuration message is written in an object file. By employing the interface configuration method and device, the configuration efficiency and accuracy are improved, and the reliability of configuration work is guaranteed.

Description

Interface allocation method and device
Technical field
The application relates to technical field of automotive electronics, particularly relates to a kind of interface allocation method and device.
Background technology
At present, the collocation method of middle layer to controller local area network (ControllerAreaNetwork, CAN) interface carries out manually having configured one by one to each interface message after understanding CAN protocol.Average each project will complete the manual configuration work of 1000 CAN message interfaces.
As can be seen here, the human configuration mode of current CAN interface takes time and effort, and reduces efficiency and the reliability of configuration.
Summary of the invention
The application is intended to solve one of technical matters in correlation technique at least to a certain extent.
For this reason, first object of the application is to propose a kind of interface allocation method, the method increases allocative efficiency and accuracy rate, ensure that the reliability of configuration effort.
Second object of the application is to propose a kind of interface configuration apparatus.
For reaching above-mentioned purpose, the application's first aspect embodiment proposes a kind of interface allocation method, comprising: obtain message information from source file; Resolve the configuration parameter in described message information; According to predefined format process, configuration parameter generates configuration message, and writes in file destination.
The interface allocation method of the embodiment of the present application, by obtaining message information from source file, resolves the configuration parameter in described message information, and according to predefined format process, configuration parameter generates configuration message, and writes in file destination.Thus, improve allocative efficiency and accuracy rate, ensure that the reliability of configuration effort.
For reaching above-mentioned purpose, the application's second aspect embodiment proposes a kind of interface configuration apparatus, comprising: acquisition module, for obtaining message information from source file; Parsing module, for resolving the configuration parameter in described message information; Processing module, generates configuration message for configuration parameter according to predefined format process, and writes in file destination.
The interface configuration apparatus of the embodiment of the present application, message information is obtained from source file by acquisition module, resolve the configuration parameter in described message information by parsing module, generate configuration message by processing module configuration parameter according to predefined format process, and write in file destination.Thus, improve allocative efficiency and accuracy rate, ensure that the reliability of configuration effort.
Accompanying drawing explanation
The present invention above-mentioned and/or additional aspect and advantage will become obvious and easy understand from the following description of the accompanying drawings of embodiments, wherein:
Fig. 1 is the process flow diagram of the interface allocation method of the application's embodiment;
Fig. 2 is the process flow diagram of the interface allocation method of another embodiment of the application;
Fig. 3 is the process flow diagram being carried out interface configuration by function call;
Fig. 4 is the 3rd function layoutprocedure process flow diagram;
Fig. 5 is the structural representation of the interface configuration apparatus of the application's embodiment.
Embodiment
Be described below in detail the embodiment of the application, the example of described embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or has element that is identical or similar functions from start to finish.Be exemplary below by the embodiment be described with reference to the drawings, be intended to for explaining the application, and the restriction to the application can not be interpreted as.
Below with reference to the accompanying drawings interface allocation method and the device of the embodiment of the present application are described.
Fig. 1 is the process flow diagram of the interface allocation method of the application's embodiment.
As shown in Figure 1, this interface allocation method comprises:
Step 101, obtains message information from source file.
Step 102, resolves the configuration parameter in described message information;
Step 103, according to predefined format process, configuration parameter generates configuration message, and writes in file destination.
Particularly, read source file according to the routing information of specifying, from source file, obtain message information.
It should be noted that for different data communication mode corresponding in different application scenarioss, different communication modes to different document forms and message format, such as:
When adopting controller local area network (ControllerAreaNetwork, CAN) bus-type communication mode to carry out data interaction, the file preserving CAN message information can be (DataBaseforCAN, DBC) file.
Configuration parameter in analytic message information.It should be noted that, different message informations has different configuration parameters, and configuration parameter kind is a lot, can comprise following one of at least:
Message instruction accords with, interface variables name, start bit, data length, coefficient, side-play amount.
According to predefined format processing configuration parameter, generate the configuration message corresponding with preset format.
The configuration message generated is write in file destination.
The interface allocation method of the embodiment of the present application, by obtaining message information from source file, resolves the configuration parameter in described message information, and according to predefined format process, configuration parameter generates configuration message, and writes in file destination.Thus, improve allocative efficiency and accuracy rate, ensure that the reliability of configuration effort.
Fig. 2 is the process flow diagram of the interface allocation method of another embodiment of the application.
As shown in Figure 2, this interface allocation method comprises:
Step 201, calls the first default function and read source file from predetermined path, and be stored in the first variable.
Step 202, calls the second default function and parse message information from described first variable, and be stored in the second variable.
Step 203, calls the 3rd default function from described second variable, resolves configuration parameter in described message information.
Step 204, is stored into each configuration parameter parsed in corresponding ternary.
Step 205, according to predefined format process, configuration parameter generates configuration message, and writes in file destination.
Step 206, the storing path of generation configuration end mark, described file destination and file name.
Specifically, the present embodiment is described through the mode executive's interface layoutprocedure of function call, comprising:
First, from predetermined path, read source file by calling the first default function, and be stored in the first variable, then from the first variable, parse message information by calling the second default function, and be stored in the second variable.
Then, the default configuration parameter of the 3rd function from the second variable in analytic message information is called.Such as: message instruction accords with, interface variables name, start bit, data length, coefficient, side-play amount.Again each configuration parameter parsed is stored in corresponding ternary.
And then according to predefined format process, configuration parameter generates configuration message, and writes in file destination.
Finally, mark configuration end mark, the storing path of file destination and file name.
In order to explanation is clearly by the mode executive's interface layoutprocedure of function call, illustrate as follows:
Fig. 3 is the process flow diagram being carried out interface configuration by function call, and Fig. 4 is the 3rd function layoutprocedure process flow diagram, see Fig. 3 and Fig. 4, specific as follows:
The first function preset is read_input (), and the first variable is pAll variable;
The second function preset is get_vcu_single_line (), and the second variable is vcu_pers variable;
The 3rd function preset is write_out_put ();
Layoutprocedure is: in Python3.4 script development environment, reads source file information in the predetermined path and be saved in pAll variable by read_input () function.
Read the value in pAll variable by get_vcu_single_line (), obtain message information, no character is heavily weeded out from pAll variable, and the message information after resolving is stored in vcu_pers variable.
Call write_out_put () function and (indications of message is comprised to each frame message information, interface variables name, start bit, data length, precision, side-play amount) parse and be saved in corresponding variable, the value of above-mentioned variable is combined according to predefined format, and the message combined is printed is stored in file destination.Finally print configuration end mark and the file destination path of preserving and file name.
The interface allocation method of the embodiment of the present application, by function call mode analytic message information, and the configuration parameter in message information, according to predefined format process, configuration parameter generates configuration message, and write in file destination, and the storing path of mark configuration end mark, described file destination and file name.Thus, improve allocative efficiency and accuracy rate, ensure that the reliability of configuration effort.
In order to realize above-described embodiment, the application also proposes a kind of interface configuration apparatus.
Fig. 5 is the structural representation of the interface configuration apparatus of the application's embodiment.
As shown in Figure 5, this interface configuration apparatus comprises:
Acquisition module 11, for obtaining message information from source file;
Parsing module 12, for resolving the configuration parameter in described message information;
Wherein, described configuration parameter comprise following one of at least:
Message instruction accords with, interface variables name, start bit, data length, coefficient, side-play amount.
Processing module 13, generates configuration message for configuration parameter according to predefined format process, and writes in file destination.
It should be noted that, the explanation of aforementioned docking port collocation method embodiment illustrates and the interface configuration apparatus being also applicable to this embodiment repeats no more herein.
The interface configuration apparatus of the embodiment of the present application, by obtaining message information from source file, resolves the configuration parameter in described message information, and according to predefined format process, configuration parameter generates configuration message, and writes in file destination.Thus, improve allocative efficiency and accuracy rate, ensure that the reliability of configuration effort.
Based on above-described embodiment, in another embodiment, acquisition module 11 for:
Call the first default function and read source file from predetermined path, and be stored in the first variable;
Call the second default function and parse message information from described first variable, and be stored in the second variable.
Parsing module 12 for:
Call the 3rd default function from described second variable, resolve configuration parameter in described message information,
Each configuration parameter parsed is stored in corresponding ternary.
Further, processing module 13 also for:
The storing path of generation configuration end mark, described file destination and file name.
It should be noted that, the explanation of aforementioned docking port collocation method embodiment illustrates and the interface configuration apparatus being also applicable to this embodiment repeats no more herein.
The interface configuration apparatus of the embodiment of the present application, by function call mode analytic message information, and the configuration parameter in message information, according to predefined format process, configuration parameter generates configuration message, and write in file destination, and the storing path of mark configuration end mark, described file destination and file name.Thus, improve allocative efficiency and accuracy rate, ensure that the reliability of configuration effort.
In the description of this instructions, at least one embodiment that specific features, structure, material or feature that the description of reference term " embodiment ", " some embodiments ", " example ", " concrete example " or " some examples " etc. means to describe in conjunction with this embodiment or example are contained in the application or example.In this manual, to the schematic representation of above-mentioned term not must for be identical embodiment or example.And the specific features of description, structure, material or feature can combine in one or more embodiment in office or example in an appropriate manner.In addition, when not conflicting, the feature of the different embodiment described in this instructions or example and different embodiment or example can carry out combining and combining by those skilled in the art.
In addition, term " first ", " second " only for describing object, and can not be interpreted as instruction or hint relative importance or imply the quantity indicating indicated technical characteristic.Thus, be limited with " first ", the feature of " second " can express or impliedly comprise at least one this feature.In the description of the application, the implication of " multiple " is at least two, such as two, three etc., unless otherwise expressly limited specifically.
Describe and can be understood in process flow diagram or in this any process otherwise described or method, represent and comprise one or more for realizing the module of the code of the executable instruction of the step of specific logical function or process, fragment or part, and the scope of the preferred implementation of the application comprises other realization, wherein can not according to order that is shown or that discuss, comprise according to involved function by the mode while of basic or by contrary order, carry out n-back test, this should understand by the embodiment person of ordinary skill in the field of the application.
In flow charts represent or in this logic otherwise described and/or step, such as, the sequencing list of the executable instruction for realizing logic function can be considered to, may be embodied in any computer-readable medium, for instruction execution system, device or equipment (as computer based system, comprise the system of processor or other can from instruction execution system, device or equipment instruction fetch and perform the system of instruction) use, or to use in conjunction with these instruction execution systems, device or equipment.With regard to this instructions, " computer-readable medium " can be anyly can to comprise, store, communicate, propagate or transmission procedure for instruction execution system, device or equipment or the device that uses in conjunction with these instruction execution systems, device or equipment.The example more specifically (non-exhaustive list) of computer-readable medium comprises following: the electrical connection section (electronic installation) with one or more wiring, portable computer diskette box (magnetic device), random access memory (RAM), ROM (read-only memory) (ROM), erasablely edit ROM (read-only memory) (EPROM or flash memory), fiber device, and portable optic disk ROM (read-only memory) (CDROM).In addition, computer-readable medium can be even paper or other suitable media that can print described program thereon, because can such as by carrying out optical scanning to paper or other media, then carry out editing, decipher or carry out process with other suitable methods if desired and electronically obtain described program, be then stored in computer memory.
Should be appreciated that each several part of the application can realize with hardware, software, firmware or their combination.In the above-described embodiment, multiple step or method can with to store in memory and the software performed by suitable instruction execution system or firmware realize.Such as, if realized with hardware, the same in another embodiment, can realize by any one in following technology well known in the art or their combination: the discrete logic with the logic gates for realizing logic function to data-signal, there is the special IC of suitable combinational logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA) etc.
Those skilled in the art are appreciated that realizing all or part of step that above-described embodiment method carries is that the hardware that can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, this program perform time, step comprising embodiment of the method one or a combination set of.
In addition, each functional unit in each embodiment of the application can be integrated in a processing module, also can be that the independent physics of unit exists, also can be integrated in a module by two or more unit.Above-mentioned integrated module both can adopt the form of hardware to realize, and the form of software function module also can be adopted to realize.If described integrated module using the form of software function module realize and as independently production marketing or use time, also can be stored in a computer read/write memory medium.
The above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.Although illustrate and described the embodiment of the application above, be understandable that, above-described embodiment is exemplary, can not be interpreted as the restriction to the application, and those of ordinary skill in the art can change above-described embodiment, revises, replace and modification in the scope of the application.

Claims (10)

1. an interface allocation method, is characterized in that, comprising:
Message information is obtained from source file;
Resolve the configuration parameter in described message information;
According to predefined format process, configuration parameter generates configuration message, and writes in file destination.
2. the method for claim 1, is characterized in that, described configuration parameter comprise following one of at least:
Message instruction accords with, interface variables name, start bit, data length, coefficient, side-play amount.
3. the method for claim 1, is characterized in that, described from source file acquisition message information, comprising:
Call the first default function and read source file from predetermined path, and be stored in the first variable;
Call the second default function and parse message information from described first variable, and be stored in the second variable.
4. method as claimed in claim 3, it is characterized in that, the configuration parameter in the described message information of described parsing, comprising:
Call the 3rd default function from described second variable, resolve configuration parameter in described message information;
Each configuration parameter parsed is stored in corresponding ternary.
5. the method as described in as arbitrary in claim 1-4, is characterized in that, after in said write file destination, also comprise:
The storing path of generation configuration end mark, described file destination and file name.
6. an interface configuration apparatus, is characterized in that, comprising:
Acquisition module, for obtaining message information from source file;
Parsing module, for resolving the configuration parameter in described message information;
Processing module, generates configuration message for configuration parameter according to predefined format process, and writes in file destination.
7. device as claimed in claim 6, is characterized in that, described configuration parameter comprise following one of at least:
Message instruction accords with, interface variables name, start bit, data length, coefficient, side-play amount.
8. device as claimed in claim 6, it is characterized in that, described acquisition module is used for:
Call the first default function and read source file from predetermined path, and be stored in the first variable;
Call the second default function and parse message information from described first variable, and be stored in the second variable.
9. device as claimed in claim 8, it is characterized in that, described parsing module is used for:
Call the 3rd default function from described second variable, resolve configuration parameter in described message information,
Each configuration parameter parsed is stored in corresponding ternary.
10. the device as described in as arbitrary in claim 6-9, is characterized in that, described processing module also for:
The storing path of generation configuration end mark, described file destination and file name.
CN201510854114.7A 2015-11-30 2015-11-30 Interface configuration method and device Pending CN105511910A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510854114.7A CN105511910A (en) 2015-11-30 2015-11-30 Interface configuration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510854114.7A CN105511910A (en) 2015-11-30 2015-11-30 Interface configuration method and device

Publications (1)

Publication Number Publication Date
CN105511910A true CN105511910A (en) 2016-04-20

Family

ID=55719917

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510854114.7A Pending CN105511910A (en) 2015-11-30 2015-11-30 Interface configuration method and device

Country Status (1)

Country Link
CN (1) CN105511910A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110012002A (en) * 2019-03-29 2019-07-12 深圳智链物联科技有限公司 Message parsing method, device and server, computer readable storage medium
CN110781635A (en) * 2019-09-27 2020-02-11 上海航天控制技术研究所 Rapid automatic design method and system for complex system contact list

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030126248A1 (en) * 2001-12-28 2003-07-03 Chambers Paul S. Method to automatically configure network routing device
CN103581353A (en) * 2012-08-02 2014-02-12 上海斐讯数据通信技术有限公司 Method and system of automatic configuration of gateway device
CN103905235A (en) * 2012-12-27 2014-07-02 北京华为数字技术有限公司 Interface configuration method and apparatus, network transmission device, and communication system
CN104092571A (en) * 2014-07-08 2014-10-08 成都振芯科技股份有限公司 Remote and automatic satellite network configuration system and method based on Beidou
CN105049281A (en) * 2015-06-25 2015-11-11 浪潮(北京)电子信息产业有限公司 Message parsing method and equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030126248A1 (en) * 2001-12-28 2003-07-03 Chambers Paul S. Method to automatically configure network routing device
CN103581353A (en) * 2012-08-02 2014-02-12 上海斐讯数据通信技术有限公司 Method and system of automatic configuration of gateway device
CN103905235A (en) * 2012-12-27 2014-07-02 北京华为数字技术有限公司 Interface configuration method and apparatus, network transmission device, and communication system
CN104092571A (en) * 2014-07-08 2014-10-08 成都振芯科技股份有限公司 Remote and automatic satellite network configuration system and method based on Beidou
CN105049281A (en) * 2015-06-25 2015-11-11 浪潮(北京)电子信息产业有限公司 Message parsing method and equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110012002A (en) * 2019-03-29 2019-07-12 深圳智链物联科技有限公司 Message parsing method, device and server, computer readable storage medium
CN110012002B (en) * 2019-03-29 2021-08-13 深圳智链物联科技有限公司 Message analysis method and device, server and computer readable storage medium
CN110781635A (en) * 2019-09-27 2020-02-11 上海航天控制技术研究所 Rapid automatic design method and system for complex system contact list

Similar Documents

Publication Publication Date Title
CN109634598B (en) Page display method, device, equipment and storage medium
CN108495192B (en) Page editing processing method and device
CN110083650B (en) Metadata self-discovery-based automatic generation method for data query interface
CN110673847A (en) Configuration page generation method and device, electronic equipment and readable storage medium
CN104238881A (en) Terminal information display method and device and terminal
CN105389299A (en) Page generation method and device
CN105338079A (en) Method and device for downloading theme pack
CN102043624A (en) Method for automatically programming intermediate communication interface and device
CN105511910A (en) Interface configuration method and device
CN111123728B (en) Unmanned vehicle simulation method, device, equipment and computer readable medium
CN110515615A (en) Business logic codes automatic generation method, device and server
CN112055018B (en) Message analysis method and device
CN105022635A (en) Algorithm file generating method and apparatus based on cloud platform and cloud platform
CN112671936A (en) Special transmission module adapting method and device for different domestic systems
CN105630466A (en) Business control method and apparatus
CN107665124B (en) Modular JavaScript file processing method, device and server
CN114003220B (en) Workflow model implementation method, system, readable storage medium and computer equipment
CN106874004B (en) Method for enabling low-version software to be compatible with high-version file, client and server
CN106557337A (en) Interface updating method and terminal
CN109344372B (en) Big data-based document generation method and system
CN112486378B (en) Graph generation method, device, terminal and storage medium
CN111123883B (en) Dual-drive unmanned vehicle simulation method, device, equipment and computer readable medium
CN105554398A (en) Video shooting method and device and electronic equipment
CN117971221B (en) Single page application layout container configuration system, method and product
CN112749159A (en) Form generation method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160420