WO2016177206A1 - 一种命令行的处理方法及装置 - Google Patents

一种命令行的处理方法及装置 Download PDF

Info

Publication number
WO2016177206A1
WO2016177206A1 PCT/CN2016/077742 CN2016077742W WO2016177206A1 WO 2016177206 A1 WO2016177206 A1 WO 2016177206A1 CN 2016077742 W CN2016077742 W CN 2016077742W WO 2016177206 A1 WO2016177206 A1 WO 2016177206A1
Authority
WO
WIPO (PCT)
Prior art keywords
command line
message
command
format
same
Prior art date
Application number
PCT/CN2016/077742
Other languages
English (en)
French (fr)
Inventor
赖小琴
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016177206A1 publication Critical patent/WO2016177206A1/zh

Links

Images

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/54Interprogram communication

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a command line processing method and apparatus.
  • the number of command lines processed each time is small, and the frequency of interaction with the APP during processing is frequent;
  • an embodiment of the present invention provides a method and a device for processing a command line.
  • the command line of the same service and different commands is assembled into the same message, and then the APP sends a message according to the message.
  • the command line is sent to the corresponding processing module for processing, and finally batch processing of multiple command lines is realized.
  • the embodiment of the present invention adopts the following technical solutions:
  • a method for processing a command line includes:
  • the step of obtaining the command line, parsing the command line, and assembling the parsed command line into a message sending message specifically includes:
  • Parsing a command line in the data packet of the first format when the command line in the first format data packet exists
  • a command line with dependencies checks the above-mentioned command line with dependencies and obtains the check result.
  • the command line is assembled to the message sending message in the same second format.
  • the step of obtaining the command line, parsing the command line, and assembling the parsed command line into the data message of the first format includes:
  • the command line with the same command ID and different attribute IDs is assembled into the data packet of the first format, wherein the content of the command line recorded in the data message of the first format includes: the attribute ID of the command line, and the command.
  • the attribute data type of the line, the attribute length of the command line, and the attribute value of the command line is assembled into the data packet of the first format, wherein the content of the command line recorded in the data message of the first format includes: the attribute ID of the command line, and the command.
  • the processing method further includes:
  • the processing method further includes:
  • the command line corresponding to the above message sending message is stored in the database.
  • the step of sending the foregoing message sending message to the application APP is specifically:
  • the above message sending message is sent to the application APP by message queue.
  • a command line processing apparatus comprising:
  • the module is configured to obtain a command line, parse the command line, and assemble the parsed command line into a message sending message, wherein the command lines of the same service and different commands are assembled to the same message sending message;
  • the sending module is configured to send the above message sending message to the application APP.
  • the foregoing assembly module specifically includes:
  • the first assembly unit is configured to acquire a command line, parse the command line, and assemble the parsed command line into a data message of a first format, wherein the command lines of the same service and different commands are assembled to the same a formatted data message;
  • a check unit configured to parse a command line in the data message of the first format, and when there is a command line with a dependency in the command line in the first format data message, the command line having the dependency relationship Check and get the school Test result
  • the second assembling unit is configured to assemble the command line to the message sending message in the same second format, if the verification result is that the verification is successful.
  • the foregoing first assembling unit specifically includes:
  • Configure the sub-units set the command line, parse the above command line, configure the same command ID for the command line of the same service, and configure different attribute IDs for the command lines of the same service and different commands.
  • the assembly subunit is configured to assemble a command line having the same command ID and different attribute IDs into the data message of the first format, wherein the content of the command line recorded in the data message of the first format includes: The attribute ID of the line, the attribute data type Type of the command line, the attribute length Length of the command line, and the attribute value Value of the command line.
  • the processing device further includes:
  • the prompting unit if the verification result is set to be unqualified, an error message is issued.
  • the processing device further includes:
  • the storage module is configured to store the command line corresponding to the above message sending message into the database.
  • the sending module is specifically configured to send the message sending message to the application APP by using a message queue.
  • a computer storage medium is further provided, and the computer storage medium may store an execution instruction for executing a processing method of the command line in the foregoing embodiment.
  • the processing method provided by the embodiment of the present invention firstly parses the obtained command line, and refines the operation function of each command to assemble different command lines of the same service into the same message sending message, that is, adopting the method.
  • the unified data structure processes different command lines of the same service.
  • the APP sends the corresponding command line to the corresponding processing module according to the message sending message, and implements batch processing of multiple different command lines. Compared with related technologies, the operation is simpler, the frequency of interaction with the APP is reduced, and the processing efficiency of the command line is greatly improved.
  • FIG. 1 is a flowchart showing a processing method of a command line in an embodiment of the present invention
  • FIG. 3 is a flowchart of assembling a command line into a data message in an embodiment of the present invention
  • Figure 4 is a diagram showing the format of a data packet in the embodiment of the present invention.
  • FIG. 5 is a diagram showing a message format of a message transmission message according to an embodiment of the present invention.
  • FIG. 6 is a timing chart showing the processing of command lines in the embodiment of the present invention.
  • Figure 7 is a block diagram showing the structure of a processing device for command lines in an embodiment of the present invention.
  • Figure 8 is a block diagram showing the structure of an assembled module in an embodiment of the present invention.
  • Fig. 9 is a block diagram showing the structure of a first assembling unit in the embodiment of the present invention.
  • a method for processing a command line includes:
  • Step S101 Obtain a command line, parse the command line, and assemble the parsed command line into a message sending message, where the command lines of the same service and different commands are assembled to the same message sending message;
  • Step S105 Send a message sending message to the application APP.
  • the command line processing method provided by the embodiment of the present invention first parses the obtained multiple command lines, and refines the operation functions of each command to assemble the command lines of the same service and different commands to the same message.
  • the unified data structure is used to process the command lines of different commands of the same service.
  • the APP sends the corresponding command line to the corresponding processing module according to the message sending message, and implements multiple different commands.
  • the batch processing of the line is simpler than the related technology, which reduces the frequency of interaction with the APP and greatly improves the processing efficiency of the command line.
  • a command line is obtained, the command line is parsed, and the parsed command line is assembled into a message sending message, where the command line assembly of the same service and different commands is assembled.
  • the processing method further includes:
  • the processing method provided by the embodiment of the present invention facilitates verification of a command line with dependencies, and when the command line is in error, it can be conveniently rolled back to the command line where the error occurs without reading from the file. Compared with related technologies, verification is more convenient.
  • step S101 obtaining a command line, parsing the command line, and assembling the parsed command line into a message sending message (step S101) specifically includes:
  • Step S1011 Obtain a command line, parse the command line, and assemble the parsed command line into a data message of the first format, where the command lines of the same service and different commands are assembled to the data message of the same first format;
  • step S1011 the command line is obtained, the command line is parsed, and the parsed command line is assembled into the data message of the first format (step S1011), which specifically includes:
  • Step S10111 Obtain a command line, parse the command line, configure the same command ID for the command line of the same service, and configure different attribute IDs for the command lines of the same service and different commands.
  • Step S10113 assembling a command line with the same command ID and different attribute IDs into the data message of the same first format
  • the content of the command line recorded in the data packet of the first format includes: an attribute ID of the command line, an attribute data type Type of the command line, an attribute length Length of the command line, and an attribute of the command line.
  • the value Value wherein the message format of the command line recorded in the above data message is as shown in FIG. 4, and each ITLV corresponds to one command line.
  • step S1013 the command line in the data packet of the first format is parsed.
  • the command line with the dependency relationship is verified and obtained.
  • step S1015 if the verification result is that the verification is successful, the command line is assembled to the message transmission message of the same second format.
  • the command line of the different commands of the same service is first assembled into the data packet of the first format, where the header of each data packet corresponds to the service.
  • the command ID is identified, so that multiple different command lines for the same service can be treated as the same object.
  • each command line in the data packet is identified by using an attribute ID corresponding thereto, which is used to distinguish command lines of different commands, and records corresponding to the command line in the data message of the first format.
  • the attribute data type Type of the command line, the attribute length Length of the command line, and the attribute value Value of the command line increase the specific attribute characteristics of different command lines. Then, the command line is parsed according to the order in the above data message.
  • the command line is assembled to the message sending message in the same second format, and the message sending message is sent to the application APP through the queue message.
  • the message is sent to the message.
  • the method of sending to the APP is not specifically limited.
  • the message format of the message transmission message is as shown in FIG.
  • the processing method when the command line with the dependency is verified, the processing method further includes:
  • step S1017 if the verification result is that the verification is unqualified, an error message is issued.
  • the timing sequence of the processing method of the command line is as shown in FIG. 6, and the specific sequence flow is as follows:
  • Step S001 obtaining a command line
  • Step S002 parsing the obtained command line
  • Step S003 The parsed command line is assembled into a data message of a first format, where the content of the command line recorded in the data message of the first format includes: an attribute ID of the command line, and an attribute data type of the command line. , the command line length length Length and the command line attribute value Value;
  • Step S004 parsing the data packet in the first format
  • Step S005 determining whether there is a command line with a dependency in the command line, if yes, then jumping to step S006; if not, then jumping to step S009;
  • Step S006 verifying the command line with dependencies according to the dependency command
  • Step S007 determining whether the verification result is qualified, when the verification result is unqualified, then the process proceeds to step S008; when the verification result is qualified, the process proceeds to step S009;
  • Step S008 issuing an error prompt
  • Step S009 storing the command line into the database, and generating a message sending message in the second format
  • Step S010 The message parsing message of the second format is parsed by the APP, and is allocated to the corresponding service module for processing.
  • a computer storage medium is further provided, and the computer storage medium may store an execution instruction for executing the method in the foregoing embodiment.
  • a command line processing apparatus is further provided. As shown in FIG. 7, the processing apparatus 700 includes:
  • the assembly module 701 is configured to acquire a command line, parse the command line, and assemble the parsed command line into a message sending message, where the command lines of the same service and different commands are assembled to the same message sending message;
  • the sending module 705 is configured to send the message sending message to the application APP.
  • the sending module 705 is specifically configured to send the message sending message to the application program by using the message queue, and it is understood that, in the embodiment of the present invention, the message sending message is sent to The APP method is not specifically limited.
  • the processing device provided by the embodiment of the present invention, by refining the operation function of each command, assembles different command lines of the same service into the same message sending message, that is, adopts a unified data structure for the same service. Different command lines perform processing.
  • the APP sends the corresponding command line to the corresponding processing module according to the message sending message, and implements batch processing of multiple different command lines. Compared with related technologies, the operation is simpler, the frequency of interaction with the APP is reduced, and the processing efficiency of the command line is greatly improved.
  • the processing apparatus 700 further includes:
  • the storage module 703 is configured to store a command line corresponding to the message sending message into the database.
  • the assembly module 701 specifically includes:
  • the first assembling unit 7011 is configured to acquire a command line, parse the command line, and assemble the parsed command line into a data message of a first format, wherein the command lines of the same service and different commands are assembled to the same first format.
  • the first assembling unit 7011 specifically includes:
  • the configuration sub-unit 70111 is configured to obtain a command line, parse the command line, configure the same command ID for the command line of the same service, and configure different attribute IDs for the command lines of the same service and different commands;
  • the assembly sub-unit 70113 is configured to assemble a command line with the same command ID and different attribute IDs into the data message of the same first format, wherein the content of the command line recorded in the data message of the first format includes: a command line The attribute ID, the attribute data type Type of the command line, the attribute length Length of the command line, and the attribute value Value of the command line, wherein the message format of the command line recorded in the above data message is as shown in FIG. 4, and each ITLV corresponds to a command line;
  • the verifying unit 7013 is configured to parse the command line in the data message in the first format, when the first format data message is If there is a command line with a dependency in the command line, the command line with the dependency is verified and the verification result is obtained.
  • the second assembling unit 7015 is configured to assemble the command line into the message sending message of the same second format, if the verification result is that the verification is qualified.
  • the message format of the message transmission message is as shown in FIG. 5, and the header object of the message transmission message, that is, the command ID, and the number of command operations in the message transmission message are recorded, and then According to the attribute IDs of different command lines and their attribute characteristics, record the specific command operations of each command line.
  • the assembly module 701 further includes:
  • the prompting unit 7017 when the verification result is set to be unqualified, issues an error prompt.
  • the processing device provided by the embodiment of the present invention facilitates verification of a command line with dependencies, and can be conveniently rolled back to the command line where the error occurs after the command line is in error without being read from the file. Compared with related technologies, verification is more convenient.
  • each of the above modules may be implemented by software or hardware.
  • the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the modules are located in multiple In the processor.
  • Embodiments of the present invention also provide a storage medium.
  • the storage medium may be configured to store program code set to perform the following steps:
  • the command line is obtained, the command line is parsed, and the parsed command line is assembled into a message sending message, wherein the command lines of the same service and different commands are assembled to the same message sending message;
  • the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • a mobile hard disk e.g., a hard disk
  • magnetic memory e.g., a hard disk
  • modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein. Perform the steps shown or described Alternatively, each of them may be fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof may be fabricated into a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software.
  • the obtained command line is first parsed, and the operation functions of each command are refined, and different command lines of the same service are assembled into the same message sending message, that is, unified data is used.
  • the structure processes different command lines of the same service, and finally the APP sends the corresponding command line to the corresponding processing module according to the message sending message, and implements batch processing of multiple different command lines.
  • the operation is simpler, the frequency of interaction with the APP is reduced, and the processing efficiency of the command line is greatly improved.

Abstract

一种命令行的处理方法及装置,该处理方法包括:获取命令行,对命令行进行解析,并将解析后的命令行组装成消息发送报文,其中,同一业务、不同命令的命令行组装至同一消息发送报文(S101);将消息发送报文发送至应用程序APP(S105)。通过提供的命令行的处理方法,能够对每一条命令的操作功能进行细化,将同一业务的不同命令行组装至同一消息发送报文中,由APP根据消息发送报文将相应的命令行发送给相应的处理模块进行处理,实现了对多个不同命令行的批量处理,与相关技术相比,操作更加简单,降低了与APP交互的频率,大大提高了命令行的处理效率。

Description

一种命令行的处理方法及装置 技术领域
本发明涉及通信技术领域,尤其涉及一种命令行的处理方法及装置。
背景技术
随着设备的业务越来越多,命令行的配置也越来越多,且有些命令行存在依赖关系。在相关技术中,APP(Application,应用程序)针对每种配置都是独立的处理流程,命令处理后写入文件,与APP的交互随着命令行的增加也更加的频繁。因此,相关技术中存在以下弊端:
1、每次处理的命令行数少,处理过程中与APP的交互频率频繁;
2、对有依赖关系的命令行的校验不方便,需要从文件中读取;
3、命令行出错后回滚不方便。
发明内容
为了克服上述技术问题,本发明实施例提供了一种命令行的处理方法及装置,通过将同一业务、不同命令的命令行组装至同一消息发送报文,然后由APP根据消息发送报文将相应的命令行发送给相应的处理模块进行处理,最终实现了对多个命令行的批量处理。
为了解决上述技术问题,本发明实施例采用如下技术方案:
依据本发明实施例的一个方面,提供了一种命令行的处理方法,该处理方法包括:
获取命令行,对上述命令行进行解析,并将解析后的命令行组装成消息发送报文,其中,同一业务、不同命令的命令行组装至同一上述消息发送报文;
将上述消息发送报文发送至应用程序APP。
可选地,上述获取命令行,对上述命令行进行解析,并将解析后的命令行组装成消息发送报文的步骤具体包括:
获取命令行,对上述命令行进行解析,将解析后的命令行组装成第一格式的数据报文,其中,上述相同业务、不同命令的命令行组装至同一上述第一格式的数据报文;
解析上述第一格式的数据报文中的命令行,当上述第一格式数据报文中的命令行中存在 有依赖关系的命令行,则对上述有依赖关系的命令行进行校验,并获取校验结果;
上述校验结果为校验合格,则将上述命令行组装至同一第二格式的上述消息发送报文。
可选地,上述获取命令行,对上述命令行进行解析,将解析后的命令行组装成第一格式的数据报文的步骤具体包括:
获取命令行,对上述命令行进行解析,为同一业务的命令行配置相同的命令ID,为同一业务、不同命令的命令行配置不同的属性ID;
将命令ID相同、属性ID不同的命令行组装至同一上述第一格式的数据报文中,其中,上述第一格式的数据报文中记录的命令行的内容包括:命令行的属性ID、命令行的属性数据类型Type、命令行的属性长度Length和命令行的属性值Value。
可选地,对上述第一格式数据报文中的命令行中有依赖关系的命令行进行校验时,上述处理方法还包括:
上述校验结果为校验不合格,则发出错误提示。
可选地,上述获取命令行,对上述命令行进行解析,并将解析后的命令行组装成消息发送报文的步骤之后,上述处理方法还包括:
将与上述消息发送报文相对应的命令行存储到数据库中。
可选地,上述将上述消息发送报文发送至应用程序APP的步骤具体为:
通过消息列队将上述消息发送报文发送至应用程序APP。
依据本发明实施例的另一个方面,还提供了一种命令行的处理装置,该处理装置包括:
组装模块,设置为获取命令行,对上述命令行进行解析,并将解析后的命令行组装成消息发送报文,其中,同一业务、不同命令的命令行组装至同一上述消息发送报文;
发送模块,设置为将上述消息发送报文发送至应用程序APP。
可选地,上述组装模块具体包括:
第一组装单元,设置为获取命令行,对上述命令行进行解析,将解析后的命令行组装成第一格式的数据报文,其中,上述相同业务、不同命令的命令行组装至同一上述第一格式的数据报文;
校验单元,设置为解析上述第一格式的数据报文中的命令行,当上述第一格式数据报文中的命令行中存在有依赖关系的命令行,则对上述有依赖关系的命令行进行校验,并获取校 验结果;
第二组装单元,设置为上述校验结果为校验合格,则将上述命令行组装至同一第二格式的上述消息发送报文。
可选地,上述第一组装单元具体包括:
配置子单元,设置为获取命令行,对上述命令行进行解析,为同一业务的命令行配置相同的命令ID,为同一业务、不同命令的命令行配置不同的属性ID;
组装子单元,设置为将命令ID相同、属性ID不同的命令行组装至同一上述第一格式的数据报文中,其中,上述第一格式的数据报文中记录的命令行的内容包括:命令行的属性ID、命令行的属性数据类型Type、命令行的属性长度Length和命令行的属性值Value。
可选地,上述处理装置还包括:
提示单元,设置为上述校验结果为校验不合格,则发出错误提示。
可选地,上述处理装置还包括:
存储模块,设置为将与上述消息发送报文相对应的命令行存储到数据库中。
可选地,上述发送模块具体设置为:通过消息列队将上述消息发送报文发送至应用程序APP。
在本发明实施例中,还提供了一种计算机存储介质,该计算机存储介质可以存储有执行指令,该执行指令用于执行上述实施例中的命令行的处理方法。
本发明实施例的有益效果是:
通过本发明实施例提供的处理方法,首先对获取得到的命令行进行解析,通过对每一条命令的操作功能进行细化,将同一业务的不同命令行组装至同一消息发送报文中,即采用统一的数据结构对同一业务的不同命令行进行处理,最后由APP根据消息发送报文将相应的命令行发送给相应的处理模块进行处理,实现了多个不同命令行的批量处理。与相关技术相比,操作更加简单,降低了与APP交互的频率,大大提高了命令行的处理效率。
附图说明
图1表示本发明实施例中命令行的处理方法的流程图;
图2表示本发明实施例中将命令行组装为消息发送报文的流程图;
图3表示本发明实施例中将命令行组装为数据报文的流程图;
图4表示本发明实施例中数据报文的报文格式;
图5表示本发明实施例中消息发送报文的报文格式;
图6表示本发明实施例中处理命令行的时序流程图;
图7表示本发明实施例中命令行的处理装置的结构框图;
图8表示本发明实施例中组装模块的结构框图;以及
图9表示本发明实施例中第一组装单元的结构框图。
具体实施方式
为使本发明的目的、技术方案和优点更加清楚,下面将结合附图及具体实施例对本发明进行详细描述。
实施例一
依据本发明实施例的一个方面,提供了一种命令行的处理方法,如图1所示,该处理方法包括:
步骤S101、获取命令行,对命令行进行解析,并将解析后的命令行组装成消息发送报文,其中,同一业务、不同命令的命令行组装至同一消息发送报文;
步骤S105、将消息发送报文发送至应用程序APP。
通过本发明实施例提供的命令行的处理方法,首先对获取的多个命令行进行解析,通过对每一条命令的操作功能进行细化,将同一业务、不同命令的命令行组装至同一消息发送报文中,即采用统一的数据结构对同一业务的不同命令的命令行进行处理,最后由APP根据消息发送报文将相应的命令行发送给相应的处理模块进行处理,实现了多个不同命令行的批量处理,与相关技术相比,操作更加简单,降低了与APP交互的频率,大大提高了命令行的处理效率。
其中,如图1所示,在本发明实施例中,获取命令行,对命令行进行解析,并将解析后的命令行组装成消息发送报文,其中,同一业务、不同命令的命令行组装至同一消息发送报文(步骤S101)之后,该处理方法还包括:
将与消息发送报文相对应的命令行存储到数据库中。
因此,通过本发明实施例提供的处理方法,便于对有依赖关系的命令行进行校验,且当命令行出错后,无需从文件中读取,即可方便地回滚到出现错误的命令行,与相关技术相比,校验更加方便。
具体地,如图2所示,在本发明实施例中,获取命令行,对命令行进行解析,并将解析后的命令行组装成消息发送报文(步骤S101)具体包括:
步骤S1011、获取命令行,对命令行进行解析,将解析后的命令行组装成第一格式的数据报文,其中,相同业务、不同命令的命令行组装至同一第一格式的数据报文;
进一步地,如图3所示,在本发明实施例中,获取命令行,对命令行进行解析,将解析后的命令行组装成第一格式的数据报文(步骤S1011)具体包括:
步骤S10111、获取命令行,对命令行进行解析,为同一业务的命令行配置相同的命令ID,为同一业务、不同命令的命令行配置不同的属性ID;
步骤S10113、将命令ID相同、属性ID不同的命令行组装至同一第一格式的数据报文中,
其中,在本发明实施例中,第一格式的数据报文中记录的命令行的内容包括:命令行的属性ID、命令行的属性数据类型Type、命令行的属性长度Length和命令行的属性值Value,其中,上述数据报文中记录的命令行的报文格式如图4所示,且每一个ITLV对应于一个命令行。
步骤S1013、解析第一格式的数据报文中的命令行,当第一格式数据报文中的命令行中存在有依赖关系的命令行,则对有依赖关系的命令行进行校验,并获取校验结果;
步骤S1015、校验结果为校验合格,则将命令行组装至同一第二格式的消息发送报文。
在本发明实施例中,在获取命令行后,首先将同一业务的不同命令的命令行组装为第一格式的数据报文,其中,每一个数据报文的报文头采用与该业务相对应的命令ID进行标识,因此,即可把针对于同一业务的多个不同命令行看作为同一个对象进行处理。另外,对数据报文中的每一条命令行采用与其相对应的属性ID进行标识,用来对不同命令的命令行进行区分,并在第一格式的数据报文中记录与命令行相对应的命令行的属性数据类型Type、命令行的属性长度Length和命令行的属性值Value,增加不同命令行的具体的属性特征。然后根据上述数据报文中的顺序对命令行进行解析,当存在有依赖关系的命令行,无需从文件中读取, 即可实现对有依赖关系的命令行进行校验,与相关技术相比,校验更加方便。最后将命令行组装至同一第二格式的消息发送报文,并通过队列消息将消息发送报文发送至应用程序APP,当然可以理解的是,在本发明实施例中,对于将消息发送报文发送至APP的方式并不进行具体限定。其中,在本发明实施例中,消息发送报文的报文格式如图5所示,记录了消息发送报文的报头对象,即命令ID,以及该消息发送报文中命令操作的数目,然后根据不同命令行的属性ID及其属性特征,分别记录每一条命令行的具体的命令操作,通过对每一条命令的操作功能进行细化,实现了对多个不同命令行的批量处理。
具体地,如图2所示,在本发明实施例中,在对有依赖关系的命令行进行校验时,该处理方法还包括:
步骤S1017、校验结果为校验不合格,则发出错误提示。其中,在本发明实施例中,该命令行的处理方法的时序流程如图6所示,其具体时序流程如下:
步骤S001、获取命令行;
步骤S002、对获取得到的命令行进行解析;
步骤S003、将解析后的命令行组装为第一格式的数据报文,其中,第一格式的数据报文中记录的命令行的内容包括:命令行的属性ID、命令行的属性数据类型Type、命令行的属性长度Length和命令行的属性值Value;
步骤S004、对第一格式的数据报文进行解析;
步骤S005、判断命令行中是否存在有依赖关系的命令行,如果存在,则跳转到步骤S006;如果不存在,则跳转到步骤S009;
步骤S006、根据依赖命令对有依赖关系的命令行进行校验;
步骤S007、判断校验结果是否合格,当校验结果为不合格,则跳转到步骤S008;当校验结果为合格,则跳转到步骤S009;
步骤S008、发出错误提示;
步骤S009、将命令行存入数据库,并生成第二格式的消息发送报文;
步骤S010、由APP解析第二格式的消息发送报文,并分配给相应的业务模块处理。
在本发明实施例中,还提供了一种计算机存储介质,该计算机存储介质可以存储有执行指令,该执行指令用于执行上述实施例中的方法。
实施例二
依据本发明实施例的另一个方面,还提供了一种命令行的处理装置,如图7所示,该处理装置700包括:
组装模块701,设置为获取命令行,对命令行进行解析,并将解析后的命令行组装成消息发送报文,其中,同一业务、不同命令的命令行组装至同一消息发送报文;
发送模块705,设置为将消息发送报文发送至应用程序APP。
其中,在本发明实施例中,发送模块705具体设置为通过消息列队将消息发送报文发送至应用程序APP,当然可以理解的是,在本发明实施例中,对于将消息发送报文发送至APP的方式并不进行具体限定。
因此,通过本发明实施例提供的处理装置,通过对每一条命令的操作功能进行细化,将同一业务的不同命令行组装至同一消息发送报文中,即采用统一的数据结构对同一业务的不同命令行进行处理,最后由APP根据消息发送报文将相应的命令行发送给相应的处理模块进行处理,实现了多个不同命令行的批量处理。与相关技术相比,操作更加简单,降低了与APP交互的频率,大大提高了命令行的处理效率。
进一步地,如图7所示,在本发明实施例中,处理装置700还包括:
存储模块703,设置为将与消息发送报文相对应的命令行存储到数据库中。
具体地,如图8所示,在本发明实施例中,组装模块701具体包括:
第一组装单元7011,设置为获取命令行,对命令行进行解析,将解析后的命令行组装成第一格式的数据报文,其中,相同业务、不同命令的命令行组装至同一第一格式的数据报文;
其中,如图9所示,在本发明实施例中,第一组装单元7011具体包括:
配置子单元70111,设置为获取命令行,对命令行进行解析,为同一业务的命令行配置相同的命令ID,为同一业务、不同命令的命令行配置不同的属性ID;
组装子单元70113,设置为将命令ID相同、属性ID不同的命令行组装至同一第一格式的数据报文中,其中,第一格式的数据报文中记录的命令行的内容包括:命令行的属性ID、命令行的属性数据类型Type、命令行的属性长度Length和命令行的属性值Value,其中,上述数据报文中记录的命令行的报文格式如图4所示,且每一个ITLV对应于一个命令行;
校验单元7013,设置为解析第一格式的数据报文中的命令行,当第一格式数据报文中的 命令行中存在有依赖关系的命令行,则对有依赖关系的命令行进行校验,并获取校验结果;
第二组装单元7015,设置为校验结果为校验合格,则将命令行组装至同一第二格式的消息发送报文。
其中,在本发明实施例中,消息发送报文的报文格式如图5所示,记录了消息发送报文的报头对象,即命令ID,以及该消息发送报文中命令操作的数目,然后根据不同命令行的属性ID及其属性特征,分别记录每一条命令行的具体的命令操作。
具体地,如图8所示,组装模块701还包括:
提示单元7017,设置为校验结果为校验不合格,则发出错误提示。
所以,通过本发明实施例提供的处理装置,便于对有依赖关系的命令行进行校验,且当命令行出错后,无需从文件中读取,即可方便地回滚到出现错误的命令行,与相关技术相比,校验更加方便。
以上的是本发明的优选实施方式,应当指出对于本技术领域的普通人员来说,在不脱离本发明的原理前提下还可以作出若干改进和润饰,这些改进和润饰也在本发明的保护范围内。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述模块分别位于多个处理器中。
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储设置为执行以下步骤的程序代码:
S1,获取命令行,对命令行进行解析,并将解析后的命令行组装成消息发送报文,其中,同一业务、不同命令的命令行组装至同一消息发送报文;
S2,将消息发送报文发送至应用程序APP。
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步 骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。
工业实用性
在本发明实施例中,首先对获取得到的命令行进行解析,通过对每一条命令的操作功能进行细化,将同一业务的不同命令行组装至同一消息发送报文中,即采用统一的数据结构对同一业务的不同命令行进行处理,最后由APP根据消息发送报文将相应的命令行发送给相应的处理模块进行处理,实现了多个不同命令行的批量处理。与相关技术相比,操作更加简单,降低了与APP交互的频率,大大提高了命令行的处理效率。

Claims (12)

  1. 一种命令行的处理方法,所述处理方法包括:
    获取命令行,对所述命令行进行解析,并将解析后的命令行组装成消息发送报文,其中,同一业务、不同命令的命令行组装至同一所述消息发送报文;
    将所述消息发送报文发送至应用程序APP。
  2. 如权利要求1所述的处理方法,其中,所述获取命令行,对所述命令行进行解析,并将解析后的命令行组装成消息发送报文的步骤具体包括:
    获取命令行,对所述命令行进行解析,将解析后的命令行组装成第一格式的数据报文,其中,所述相同业务、不同命令的命令行组装至同一所述第一格式的数据报文;
    解析所述第一格式的数据报文中的命令行,当所述第一格式数据报文中的命令行中存在有依赖关系的命令行,则对所述有依赖关系的命令行进行校验,并获取校验结果;
    所述校验结果为校验合格,则将所述命令行组装至同一第二格式的所述消息发送报文。
  3. 如权利要求2所述的处理方法,其中,所述获取命令行,对所述命令行进行解析,将解析后的命令行组装成第一格式的数据报文的步骤具体包括:
    获取命令行,对所述命令行进行解析,为同一业务的命令行配置相同的命令ID,为同一业务、不同命令的命令行配置不同的属性ID;
    将命令ID相同、属性ID不同的命令行组装至同一所述第一格式的数据报文中,其中,所述第一格式的数据报文中记录的命令行的内容包括:命令行的属性ID、命令行的属性数据类型Type、命令行的属性长度Length和命令行的属性值Value。
  4. 如权利要求2所述的处理方法,其中,对所述第一格式数据报文中的命令行中有依赖关系的命令行进行校验时,所述处理方法还包括:
    所述校验结果为校验不合格,则发出错误提示。
  5. 如权利要求1所述的处理方法,其中,所述获取命令行,对所述命令行进行解析,并将解析后的命令行组装成消息发送报文的步骤之后,所述处理方法还包括:
    将与所述消息发送报文相对应的命令行存储到数据库中。
  6. 如权利要求1所述的处理方法,其中,所述将所述消息发送报文发送至应用程序APP的步骤具体为:
    通过消息列队将所述消息发送报文发送至应用程序APP。
  7. 一种命令行的处理装置,所述处理装置包括:
    组装模块,设置为获取命令行,对所述命令行进行解析,并将解析后的命令行组装 成消息发送报文,其中,同一业务、不同命令的命令行组装至同一所述消息发送报文;
    发送模块,设置为将所述消息发送报文发送至应用程序APP。
  8. 如权利要求7所述的处理装置,其中,所述组装模块具体包括:
    第一组装单元,设置为获取命令行,对所述命令行进行解析,将解析后的命令行组装成第一格式的数据报文,其中,所述相同业务、不同命令的命令行组装至同一所述第一格式的数据报文;
    校验单元,设置为解析所述第一格式的数据报文中的命令行,当所述第一格式数据报文中的命令行中存在有依赖关系的命令行,则对所述有依赖关系的命令行进行校验,并获取校验结果;
    第二组装单元,设置为所述校验结果为校验合格,则将所述命令行组装至同一第二格式的所述消息发送报文。
  9. 如权利要求8所述的处理装置,其中,所述第一组装单元具体包括:
    配置子单元,设置为获取命令行,对所述命令行进行解析,为同一业务的命令行配置相同的命令ID,为同一业务、不同命令的命令行配置不同的属性ID;
    组装子单元,设置为将命令ID相同、属性ID不同的命令行组装至同一所述第一格式的数据报文中,其中,所述第一格式的数据报文中记录的命令行的内容包括:命令行的属性ID、命令行的属性数据类型Type、命令行的属性长度Length和命令行的属性值Value。
  10. 如权利要求8所述的处理装置,其中,所述处理装置还包括:
    提示单元,设置为所述校验结果为校验不合格,则发出错误提示。
  11. 如权利要求7所述的处理装置,其中,所述处理装置还包括:
    存储模块,设置为将与所述消息发送报文相对应的命令行存储到数据库中。
  12. 如权利要求7所述的处理装置,其中,所述发送模块具体设置为:通过消息列队将所述消息发送报文发送至应用程序APP。
PCT/CN2016/077742 2015-07-27 2016-03-29 一种命令行的处理方法及装置 WO2016177206A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510446080.8 2015-07-27
CN201510446080.8A CN106406825A (zh) 2015-07-27 2015-07-27 一种命令行的处理方法及装置

Publications (1)

Publication Number Publication Date
WO2016177206A1 true WO2016177206A1 (zh) 2016-11-10

Family

ID=57217433

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/077742 WO2016177206A1 (zh) 2015-07-27 2016-03-29 一种命令行的处理方法及装置

Country Status (2)

Country Link
CN (1) CN106406825A (zh)
WO (1) WO2016177206A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109617647A (zh) * 2018-10-22 2019-04-12 中国平安财产保险股份有限公司 报文转换方法、装置、计算机设备及计算机可读存储介质
CN110874221A (zh) * 2019-11-19 2020-03-10 深圳忆联信息系统有限公司 基于命令行的ssd固件打包方法、装置及计算机设备
CN113065338A (zh) * 2021-04-08 2021-07-02 银清科技有限公司 Xml报文重组方法及装置
CN113138861A (zh) * 2020-01-18 2021-07-20 佛山市云米电器科技有限公司 基于设备服务系统的消息处理方法、系统及存储介质
CN113810198A (zh) * 2021-09-18 2021-12-17 深圳忆联信息系统有限公司 Ssd固件数字签名的方法、装置、计算机设备及存储介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113001538B (zh) * 2019-12-20 2022-08-26 合肥欣奕华智能机器股份有限公司 一种命令解析方法及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1787459A (zh) * 2005-12-22 2006-06-14 杭州华为三康技术有限公司 一种下发命令的方法和系统
CN101079737A (zh) * 2007-06-08 2007-11-28 中兴通讯股份有限公司 一种命令行接口命令的自动构造与解析方法及其系统
CN101686451A (zh) * 2008-09-27 2010-03-31 深圳华为通信技术有限公司 一种ussd的实现方法和装置
CN103209153A (zh) * 2012-01-16 2013-07-17 阿里巴巴集团控股有限公司 消息处理方法、装置及系统

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101340268B (zh) * 2008-08-18 2011-06-29 杭州华三通信技术有限公司 节点间通信确认机制的实现方法和实现系统
CN102075432B (zh) * 2011-01-25 2012-11-28 上海聚欣网络科技有限公司 一种用于发送及接收报文的方法、装置、设备及系统
CN102624894B (zh) * 2012-03-09 2014-10-22 北京思特奇信息技术股份有限公司 一种报文组装与解析的方法和系统
CN102647358A (zh) * 2012-04-24 2012-08-22 北京星网锐捷网络技术有限公司 报文发送和处理方法、装置、客户端设备和网络设备
CN102938739B (zh) * 2012-11-26 2016-08-24 华为技术有限公司 深度报文检查方法与装置
CN104040967B (zh) * 2012-12-07 2017-08-18 华为技术有限公司 一种报文的流转发方法及报文转发设备
CN103117872A (zh) * 2012-12-31 2013-05-22 广东东研网络科技股份有限公司 一种提高snmp数据传输效率的方法
CN103532756B (zh) * 2013-10-15 2017-01-25 上海寰创通信科技股份有限公司 一种基于网管系统的命令行系统以及命令行操作方法
CN104486344A (zh) * 2014-12-22 2015-04-01 上海斐讯数据通信技术有限公司 一种基于snmp的用户访问系统及其访问方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1787459A (zh) * 2005-12-22 2006-06-14 杭州华为三康技术有限公司 一种下发命令的方法和系统
CN101079737A (zh) * 2007-06-08 2007-11-28 中兴通讯股份有限公司 一种命令行接口命令的自动构造与解析方法及其系统
CN101686451A (zh) * 2008-09-27 2010-03-31 深圳华为通信技术有限公司 一种ussd的实现方法和装置
CN103209153A (zh) * 2012-01-16 2013-07-17 阿里巴巴集团控股有限公司 消息处理方法、装置及系统

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109617647A (zh) * 2018-10-22 2019-04-12 中国平安财产保险股份有限公司 报文转换方法、装置、计算机设备及计算机可读存储介质
CN110874221A (zh) * 2019-11-19 2020-03-10 深圳忆联信息系统有限公司 基于命令行的ssd固件打包方法、装置及计算机设备
CN113138861A (zh) * 2020-01-18 2021-07-20 佛山市云米电器科技有限公司 基于设备服务系统的消息处理方法、系统及存储介质
CN113065338A (zh) * 2021-04-08 2021-07-02 银清科技有限公司 Xml报文重组方法及装置
CN113810198A (zh) * 2021-09-18 2021-12-17 深圳忆联信息系统有限公司 Ssd固件数字签名的方法、装置、计算机设备及存储介质

Also Published As

Publication number Publication date
CN106406825A (zh) 2017-02-15

Similar Documents

Publication Publication Date Title
WO2016177206A1 (zh) 一种命令行的处理方法及装置
CN106328126B (zh) 远场语音识别处理方法及装置
US10091356B2 (en) Interactive voice response system crawler
CN108334545B (zh) 一种实现异步服务的方法及装置
US9432508B2 (en) System and method for interactive voice response unit table-based programming
US9183528B2 (en) Generating a compliance data model for IT control
CN110147240A (zh) 基于云存储的应用程序安装方法、系统及存储介质
CN105468300B (zh) Ip硬盘的管理方法和装置
CN110060656B (zh) 模型管理和语音合成方法、装置和系统及存储介质
WO2017016282A1 (zh) 软件升级方法及装置、计算机存储介质
US11790886B2 (en) System and method for synthesizing automated test cases from natural interactions
US9753711B1 (en) Automated implementation of best practices for solution deployment
CN110247857B (zh) 限流方法及装置
CN110519329A (zh) 一种并发处理samba协议请求的方法、设备及可读介质
CN111124486A (zh) 发现安卓应用引用第三方工具的方法、系统及存储介质
US10419606B2 (en) Call recording test suite
JP2017182783A (ja) 自動化されたエンドツーエンドのウェブ対話試験のためのシステム及び方法
CN110515698A (zh) 一种资源申请方法、系统及电子设备和存储介质
CN112732367A (zh) 事件流程的处理方法、装置、设备及可读存储介质
CN108920172A (zh) 用于语音对话平台的程序发布和调用方法及系统
CN109286608A (zh) 调用链处理方法、装置及存储设备、计算机设备
US10628439B1 (en) System and method for movie digital content version control access during file delivery and playback
US9672040B2 (en) Apparatus and method for determining a cumulative size of trace messages generated by a plurality of instructions
CN114979040B (zh) 一种udp报文写入方法及系统及装置及介质
US8364787B2 (en) Automatically adjusting command parameters to support devices of a computer network

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16789200

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16789200

Country of ref document: EP

Kind code of ref document: A1