CN111404778A - Gateway testing method and device and computer readable storage medium - Google Patents

Gateway testing method and device and computer readable storage medium Download PDF

Info

Publication number
CN111404778A
CN111404778A CN202010171634.9A CN202010171634A CN111404778A CN 111404778 A CN111404778 A CN 111404778A CN 202010171634 A CN202010171634 A CN 202010171634A CN 111404778 A CN111404778 A CN 111404778A
Authority
CN
China
Prior art keywords
gateway
memory
service instance
testing method
utilization rate
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
CN202010171634.9A
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.)
Shenzhen Tenda Technology Co Ltd
Original Assignee
Shenzhen Tenda Technology 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 Shenzhen Tenda Technology Co Ltd filed Critical Shenzhen Tenda Technology Co Ltd
Priority to CN202010171634.9A priority Critical patent/CN111404778A/en
Publication of CN111404778A publication Critical patent/CN111404778A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/14Arrangements for monitoring or testing data switching networks using software, i.e. software packages

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a gateway testing method, a device and a computer readable storage medium, wherein the gateway testing method comprises the following steps: calling a service instance in object-oriented programming language java through a gateway application program interface API (application program interface), wherein the service instance is used for consuming a gateway memory and/or consuming gateway CPU (Central processing Unit) resources after being called; inquiring the gateway memory utilization rate and/or the CPU utilization rate in real time or at regular time; and determining the performance of the gateway according to the query result. The gateway testing method mainly solves the technical problem that the existing gateway testing technology is incomplete.

Description

Gateway testing method and device and computer readable storage medium
Technical Field
The present invention relates to the field of electronic technologies, and in particular, to a gateway testing method and apparatus, and a computer-readable storage medium.
Background
The gateway test usually needs to consume the gateway memory and CPU system resources, and the purpose of testing the reliability and stability of the gateway is achieved when the gateway system resource consumption reaches a threshold (generally 60%).
In the existing testing technology, a large number of plug-ins are installed in a gateway system to consume a gateway memory or to consume a CPU resource by sending an attack message. The reliability and stability test of the gateway needs continuous and stable consumption of memory and CPU utilization rate, and the existing test technology has many defects:
1. the memory consumption of the gateway is tested by installing a large number of plug-ins, and a large number of plug-ins need to be compiled, so that the operation is complex; after the plug-in is installed, if the installed plug-in does not call the interface corresponding to the gateway, the effect that one numerical value of the memory is fixedly occupied and the real-time and effective consumption of the gateway memory cannot be achieved is achieved.
2. The utilization rate of a gateway CPU is consumed by sending the attack message through the instrument, the instrument is required to be occupied, the sending flow is also required, and the sending of the attack message belongs to abnormal tests.
3. In the actual test process, the memory consumption is not obvious, the CPU utilization rate effect cannot be stably controlled in a certain interval, and the CPU utilization rate jitter changes greatly.
Disclosure of Invention
The invention provides a gateway testing method, a gateway testing device and a computer readable storage medium, which mainly solve the technical problem that the existing gateway testing technology is incomplete.
The gateway testing method provided by the invention comprises the following steps:
calling a service instance in object-oriented programming language java through a gateway application program interface API (application program interface), wherein the service instance is used for consuming a gateway memory and/or consuming gateway CPU (Central processing Unit) resources after being called;
inquiring the gateway memory utilization rate and/or the CPU utilization rate in real time or at regular time;
and determining the performance of the gateway according to the query result.
The gateway testing device provided by the invention comprises:
the calling module is used for calling a service instance in object-oriented programming language java through a gateway application program interface API (application program interface), and the service instance is used for consuming a gateway memory and/or consuming gateway CPU (Central processing Unit) resources after being called;
the query module is used for querying the gateway memory utilization rate and/or the CPU utilization rate in real time or at regular time;
and the determining module is used for determining the performance of the gateway according to the query result.
The invention provides a testing device, which comprises a processor, a memory and a communication bus for connecting the processor and the memory;
the processor is configured to execute one or more computer programs stored in the memory to implement the steps of the gateway testing method described above.
The present invention provides a computer readable storage medium storing one or more computer programs, which are executable by one or more processors to implement the steps of the gateway testing method described above.
According to the gateway testing method, the gateway testing device and the computer readable storage medium, only one jar testing plug-in needs to be developed, codes are developed through java (object oriented programming language) for gateway memory consumption and gateway CPU resource consumption, and service instances in java are called through API (gateway application program interface), so that the memory consumption and CPU consumption functions are realized. The operation is simple and the control is easier.
Drawings
Fig. 1 is a flowchart of a gateway testing method according to a first embodiment of the present invention.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The present invention will be described in further detail with reference to specific examples.
First embodiment
Referring to fig. 1, fig. 1 is a flowchart of a gateway testing method according to a first embodiment of the present invention, where the gateway testing method mainly includes:
s101, calling a service instance in object-oriented programming language java through a gateway application program interface API (application program interface), wherein the service instance is used for consuming a gateway memory and/or consuming gateway CPU (Central processing Unit) resources after being called;
s102, inquiring the utilization rate of the gateway memory and/or the utilization rate of a CPU in real time or at regular time;
s103, determining the performance of the gateway according to the query result.
In step S101, the invoking a service instance in object oriented programming language java through a gateway application program interface API in the preset time period may include:
starting a timer, and calling a service instance in object-oriented programming language java through a gateway application program interface API in a timer section; and releasing the service instance after the timer time is up.
After step S102, the method may further include:
if the current CPU utilization rate is inquired to be too low, the CPU resource consumption is increased in the step S101 calling the service instance, and if the current CPU utilization rate is inquired to be too high, the CPU resource consumption is reduced in the step S101 calling the service instance.
In S103, the performance of the gateway may include: reliability and stability of the gateway.
Determining the performance of the gateway according to the query result in S103 may include: and comparing the query result with a preset standard value, and obtaining the performance grade of the gateway according to the comparison result. For example: the preset standard value 1 corresponds to a first performance level, the preset standard value 2 corresponds to a second performance level, the preset standard value 3 corresponds to a third performance level and the like, wherein the first performance level, the second performance level and the third performance level are sequentially increased in level, and the higher the level is, the better the performance of the gateway is.
The gateway testing method provided by the embodiment only needs to develop a jar testing plug-in, and the memory consumption and the gateway CPU resource consumption of the gateway are developed through java (object oriented programming language), and the service instance in the java is called through API (application program interface), so that the memory consumption and CPU consumption functions are realized. The operation is simple and the control is easier.
Second embodiment
The gateway testing apparatus provided in this embodiment mainly includes:
the calling module is used for calling a service instance in object-oriented programming language java through a gateway application program interface API (application program interface), and the service instance is used for consuming a gateway memory and/or consuming gateway CPU (Central processing Unit) resources after being called;
the query module is used for querying the gateway memory utilization rate and/or the CPU utilization rate in real time or at regular time;
and the determining module is used for determining the performance of the gateway according to the query result.
The above respective modules may implement the respective corresponding steps in the first embodiment.
The embodiment also provides a testing device, which comprises a processor, a memory and a communication bus for connecting the processor and the memory;
the processor is configured to execute one or more computer programs stored in the memory to implement the steps of the gateway testing method of any of the first embodiments.
The gateway testing apparatus and the computer-readable storage medium provided in this embodiment only need to develop a jar testing plug-in, develop codes for gateway memory consumption and gateway CPU resource consumption through java (object oriented programming language), and call service instances in java through API (gateway application program interface), so as to implement memory consumption and CPU consumption functions. The operation is simple and the control is easier.
Third embodiment
In this embodiment, software is used to implement the gateway testing method of the present invention, and the configuration and connection description are as follows:
1) jar test plug-ins can be created by JDK (Java Development Kit, a software Development Kit in Java language),
2) building an HTTP server;
3) locally executing the permission installation command: sidbg 1DB set CMCCOSGIInfo 0Accdefult 1
4) The local execution command: andbg 74 sgid insert name ═ com.zxic.demo url ═ http://192.168.10.3/com.zxic.demo _1.0.0.jar fsize ═ 1962, test demo plug-in installation was performed;
5) checking the running state of the plug-in;
6) and recording the log information through a securecRT terminal.
Description of the working principle:
1) after the testing demo plug-in is installed, the plug-in can automatically install the authority, and automatically enter the running state after the authority is installed;
2) after the jar test plug-in enters the Active, calling a Service instance according to a plug-in Service instance to respectively realize gateway CPU resource consumption and gateway memory consumption, and regularly inquiring gateway CPU utilization rate and gateway memory utilization rate;
3) the 24-hour CPU usage and memory usage are collected via local logs.
4) Analyzing the 24-hour running state of the gateway in the continuous consumption memory utilization rate and the CPU utilization rate, and judging the reliability and stability of the gateway.
In the prior art, different plug-ins are required to respectively consume the gateway memory and the CPU utilization rate, the testing steps are complex, and resources are consumed. In the embodiment, by developing the jar test plug-in, the memory consumption and the CPU utilization rate are consumed by java to develop a code which consumes the memory and the CPU, and the service instance in the java is called through the API (application program interface), so that the memory consumption and CPU consumption functions are realized.
The prior testing technology tests the consumption of the gateway memory by installing a large number of plug-ins, and achieves the effect that one segment of the memory is fixedly occupied, so that the effect of effectively consuming the gateway memory in real time cannot be achieved. In the embodiment, the service instance is circularly called by the jar plug-in to consume the memory, the memory consumption can be achieved by occupying the gateway memory resource in the timer section through the timer, and the memory is released after the timer is over, so that the effect of effectively consuming the gateway memory in real time is achieved.
In the prior art, the utilization rate of a gateway CPU is consumed by sending attack messages through a meter, the attack messages belong to abnormal tests, the utilization rate of the gateway CPU is unstable, and the gateway CPU cannot be controlled in a certain interval for a long time. According to the embodiment, the utilization rate consumption of the CPU can be realized by circularly calling the service instance through the jar plug-in, the utilization rate change of the CPU is realized by regularly inquiring the gateway, the regulation and control are performed based on the current CPU utilization rate, if the CPU utilization rate is too low, the utilization rate of the CPU is increased by calling the service instance, and if the CPU utilization rate is too high, the utilization rate of the CPU is reduced by calling the service instance, so that the consumption of the gateway CPU utilization rate is stably kept in a fixed interval.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments. Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (8)

1. A gateway testing method, comprising:
calling a service instance in object-oriented programming language java through a gateway application program interface API (application program interface), wherein the service instance is used for consuming a gateway memory and/or consuming gateway CPU (Central processing Unit) resources after being called;
inquiring the gateway memory utilization rate and/or the CPU utilization rate in real time or at regular time;
and determining the performance of the gateway according to the query result.
2. The gateway testing method of claim 1, wherein calling the service instance in object oriented programming language java through a gateway application program interface API within the preset time period comprises:
starting a timer, and calling a service instance in object-oriented programming language java through a gateway application program interface API in a timer section; and releasing the service instance after the timer time is up.
3. The gateway testing method of claim 1, further comprising:
if the current CPU utilization rate is inquired to be too low, the CPU resource consumption is increased in the service instance, and if the current CPU utilization rate is inquired to be too high, the CPU resource consumption is reduced in the service instance.
4. A gateway testing method according to any of claims 1 to 3, wherein the performance of the gateway comprises: reliability and stability of the gateway.
5. The gateway testing method of claim 4, wherein said determining the performance of the gateway based on the query result comprises: and comparing the query result with a preset standard value, and obtaining the performance grade of the gateway according to the comparison result.
6. A gateway testing apparatus, comprising:
the calling module is used for calling a service instance in object-oriented programming language java through a gateway application program interface API (application program interface), and the service instance is used for consuming a gateway memory and/or consuming gateway CPU (Central processing Unit) resources after being called;
the query module is used for querying the gateway memory utilization rate and/or the CPU utilization rate in real time or at regular time;
and the determining module is used for determining the performance of the gateway according to the query result.
7. A test apparatus comprising a processor, a memory, and a communication bus connecting the processor and the memory;
the processor is configured to execute one or more computer programs stored in the memory to implement the steps of the gateway testing method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that the computer-readable storage medium stores one or more computer programs executable by one or more processors to implement the steps of the gateway testing method according to any one of claims 1 to 5.
CN202010171634.9A 2020-03-12 2020-03-12 Gateway testing method and device and computer readable storage medium Pending CN111404778A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010171634.9A CN111404778A (en) 2020-03-12 2020-03-12 Gateway testing method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010171634.9A CN111404778A (en) 2020-03-12 2020-03-12 Gateway testing method and device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN111404778A true CN111404778A (en) 2020-07-10

Family

ID=71432380

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010171634.9A Pending CN111404778A (en) 2020-03-12 2020-03-12 Gateway testing method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111404778A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060140144A1 (en) * 2004-12-27 2006-06-29 Motorola, Inc. Method and system for providing an open gateway initiative bundle over the air
CN103209101A (en) * 2012-01-17 2013-07-17 深圳市共进电子股份有限公司 Gateway testing method
CN109766278A (en) * 2019-01-10 2019-05-17 中天宽带技术有限公司 The backstage gateway WEB automatic test approach based on OSGI frame
CN109995584A (en) * 2019-03-19 2019-07-09 广东九联科技股份有限公司 A kind of fault diagnosis auxiliary system and its method based on intelligent gateway
CN110601915A (en) * 2019-08-12 2019-12-20 深圳市同维通信技术有限公司 Method and device for testing gateway device
CN110609781A (en) * 2019-08-29 2019-12-24 凡普数字技术有限公司 Interface test method, device and storage medium
CN110784371A (en) * 2019-10-15 2020-02-11 四川天邑康和通信股份有限公司 Gateway network quality testing method and system based on OSGI technology

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060140144A1 (en) * 2004-12-27 2006-06-29 Motorola, Inc. Method and system for providing an open gateway initiative bundle over the air
CN103209101A (en) * 2012-01-17 2013-07-17 深圳市共进电子股份有限公司 Gateway testing method
CN109766278A (en) * 2019-01-10 2019-05-17 中天宽带技术有限公司 The backstage gateway WEB automatic test approach based on OSGI frame
CN109995584A (en) * 2019-03-19 2019-07-09 广东九联科技股份有限公司 A kind of fault diagnosis auxiliary system and its method based on intelligent gateway
CN110601915A (en) * 2019-08-12 2019-12-20 深圳市同维通信技术有限公司 Method and device for testing gateway device
CN110609781A (en) * 2019-08-29 2019-12-24 凡普数字技术有限公司 Interface test method, device and storage medium
CN110784371A (en) * 2019-10-15 2020-02-11 四川天邑康和通信股份有限公司 Gateway network quality testing method and system based on OSGI technology

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
WZ-YONG: "FPS(检测内存和CPU消耗)", 《百度》 *
尘封086: "(终端,板子…)Linux下模拟CPU/内存占用工具打包发布+使用说明-cpuup&memup", 《百度》 *

Similar Documents

Publication Publication Date Title
CN107229566B (en) Method and system for maintaining functional consistency of SOA service conversion language
CN109766172B (en) Asynchronous task scheduling method and device
CN107729213B (en) Background task monitoring method and device
CN112579304A (en) Resource scheduling method, device, equipment and medium based on distributed platform
CN111130821B (en) Power failure alarm method, processing method and device
EP1977324A1 (en) Terminal and method for performing device management scheduled based on threshold
US20070174444A1 (en) Terminal and method for performing device management scheduled based on threshold
CN112817772B (en) Data communication method, device, equipment and storage medium
CN110333916B (en) Request message processing method, device, computer system and readable storage medium
CN111949421B (en) SDK calling method, device, electronic equipment and computer readable storage medium
CN109144676B (en) Self-starting detection method and device of application program and server
CN107741891B (en) Object reconstruction method, medium, device and computing equipment
CN110362314B (en) Information processing method and device, computer readable medium and electronic equipment
CN111404778A (en) Gateway testing method and device and computer readable storage medium
CN112363897A (en) Full link log tracking method, device and storage medium
CN114490091B (en) Method and device for monitoring rule engine performance in industrial data acquisition management system
CN111082964A (en) Distribution method and device of configuration information
CN109684846A (en) A kind of file extraction method and device
CN101964922B (en) Abnormal condition capturing method and device
CN113590178A (en) API (application program interface) instance management method and device, storage medium and electronic equipment
CN113515293A (en) Method and system for managing DevOps tool chain
CN113098936A (en) Method, device and equipment for pushing message to mobile terminal
CN112967416A (en) Vehicle monitoring method, device and system, vehicle monitoring equipment and terminal equipment
CN110955579A (en) Ambari-based large data platform monitoring method
CN111459819A (en) Software testing method and device, electronic equipment and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for 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: 20200710