CN115426297A - Function test method and device of sub-equipment, computer equipment and storage medium - Google Patents

Function test method and device of sub-equipment, computer equipment and storage medium Download PDF

Info

Publication number
CN115426297A
CN115426297A CN202210950439.5A CN202210950439A CN115426297A CN 115426297 A CN115426297 A CN 115426297A CN 202210950439 A CN202210950439 A CN 202210950439A CN 115426297 A CN115426297 A CN 115426297A
Authority
CN
China
Prior art keywords
sub
tested
data
equipment
development board
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.)
Granted
Application number
CN202210950439.5A
Other languages
Chinese (zh)
Other versions
CN115426297B (en
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.)
Hangzhou Tuya Information Technology Co Ltd
Original Assignee
Hangzhou Tuya Information 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 Hangzhou Tuya Information Technology Co Ltd filed Critical Hangzhou Tuya Information Technology Co Ltd
Priority to CN202210950439.5A priority Critical patent/CN115426297B/en
Publication of CN115426297A publication Critical patent/CN115426297A/en
Application granted granted Critical
Publication of CN115426297B publication Critical patent/CN115426297B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer And Data Communications (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to a method and a device for testing the functions of sub-equipment, computer equipment, a computer readable storage medium and a computer program product, wherein the sub-equipment to be tested is simulated by controlling a sub-equipment development board; after the sub-equipment development board successfully simulates the sub-equipment to be tested, controlling the sub-equipment development board and a gateway butted with the sub-equipment development board to enter a distribution network mode; after the sub-equipment development board and the gateway distribution network butted with the sub-equipment development board are successful, acquiring function points to be tested of the sub-equipment to be tested, and simulation operation data and expected data corresponding to the function points to be tested; sequentially traversing each functional point to be tested, processing the simulation operation data corresponding to the current functional point to be tested according to the real data flow process of the current functional point to be tested, and taking the data obtained from the end point of the data flow as the data to be verified; and comparing the data to be verified with the expected data to determine whether the current functional point to be tested is normal or not, thereby effectively improving the efficiency of the functional test of the sub-equipment.

Description

Function test method and device of sub-equipment, computer equipment and storage medium
Technical Field
The present application relates to the field of communications technologies of the internet of things, and in particular, to a method and an apparatus for testing a function of a piece of sub-equipment, a computer device, a computer-readable storage medium, and a computer program product.
Background
Because the program of the gateway can be updated continuously, after each update, before the gateway is formally on-line, the function of the sub-equipment which is connected with the gateway needs to be tested, and whether the processing of the functional data of the sub-equipment by the gateway is normal or not is determined, so that whether the function of the sub-equipment can be normally connected by the gateway or not is determined.
In the prior art, whether the functions of the sub-devices connected with the gateway are normal is sequentially tested in a manual mode, however, the manual testing mode is too slow and the probability of misoperation is increased, so that the problem that the efficiency of testing the functions of the sub-devices is too low exists in the prior art.
Disclosure of Invention
In view of the foregoing, it is necessary to provide a method, an apparatus, a computer device, a computer readable storage medium, and a computer program product for functional testing of a sub-device to solve the problem of inefficient functional testing of the sub-device in the related art.
In a first aspect, an embodiment of the present application provides a method for testing a function of a piece of sub-equipment, where the method includes the following steps:
the control sub-equipment development board simulates the sub-equipment to be tested;
after a result that the sub-equipment development board successfully simulates the sub-equipment to be tested is obtained, the sub-equipment development board and a gateway butted with the sub-equipment development board are controlled to enter a distribution network mode, so that communication protocol data are communicated between the sub-equipment development board and the gateway;
after the sub-equipment development board and the gateway distribution network butted with the sub-equipment development board are successful, acquiring function points to be tested of the sub-equipment to be tested, and simulation operation data and expected data corresponding to the function points to be tested;
sequentially traversing each function point to be tested, processing the simulation operation data corresponding to the current function point to be tested according to the real data flow process of the current function point to be tested, and taking the data obtained from the end point of data flow as data to be verified;
and comparing the data to be verified with the expected data to determine whether the current functional point to be tested is normal.
In some embodiments, the method for simulating a sub-device to be tested by the control sub-device development board comprises the following steps:
and controlling the sub-equipment development board to load the configuration information of the sub-equipment to be tested, so that the sub-equipment development board simulates the sub-equipment to be tested.
In some embodiments, before the controlling the sub-device development board loads the configuration information of the sub-device to be tested, the method further includes:
sending the configuration file of the sub-equipment to be tested to the sub-equipment development board; the configuration file records the configuration information of the sub-equipment to be tested;
and controlling the sub-equipment development board to analyze the configuration file so as to obtain the configuration information of the sub-equipment to be tested.
In some embodiments, the processing the simulation operation data of the current function point to be tested according to the real data flow process of the current function point to be tested, and taking the data obtained from the end point of the data flow as the data to be verified includes the following steps:
judging whether the trigger source of the current functional point to be tested is the gateway or not;
if so, sending the simulation operation data of the current functional point to be tested to the gateway, sending the data subjected to the logic processing of the gateway to the sub-equipment development board, and finally taking the data received by the sub-equipment development board as the data to be verified.
In some of these embodiments, the method further comprises:
judging whether the trigger source of the current functional point to be tested is the sub-equipment development board or not;
if yes, sending the simulation operation data of the current functional point to be tested to the sub-equipment development board, controlling the sub-equipment development board to convert the simulation operation data into protocol data in butt joint with the gateway, forwarding the protocol data to the gateway, and finally taking the data subjected to logic processing by the gateway as the data to be verified.
In some embodiments, the comparing the data to be verified and the expected data to determine whether the current function point to be tested is normal includes the following steps:
comparing the data to be verified with the expected data, and judging whether the data to be verified and the expected data are consistent;
if the data to be verified is consistent with the expected data, determining that the current functional point to be tested is normal;
and if the data to be verified is inconsistent with the expected data, determining that the current functional point to be tested is abnormal.
In a second aspect, an embodiment of the present application provides a function testing apparatus for a sub-device, where the apparatus includes an upper computer, a gateway, and a sub-device development board;
the upper computer is connected with the gateway through a network; the upper computer is connected with the sub-equipment development board through a serial port;
the upper computer is used for executing the steps of the method of any one of claims 1 to 6.
In a third aspect, there is provided in this embodiment a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method according to the first aspect when executing the computer program.
In a fourth aspect, in the present embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the method according to the first aspect as described above.
In a fifth aspect, the present application further provides a computer program product. The computer program product comprising a computer program that when executed by a processor performs the steps of the method of the first aspect.
The functional test method and device of the sub-equipment, the computer readable storage medium and the computer program product simulate the sub-equipment to be tested by controlling the sub-equipment development board; after the result that the sub-equipment development board successfully simulates the sub-equipment to be tested is obtained, the sub-equipment development board and a gateway butted with the sub-equipment development board are controlled to enter a distribution network mode, so that communication protocol data are communicated between the sub-equipment development board and the gateway; after the sub-equipment development board and the gateway distribution network butted with the sub-equipment development board are successful, acquiring function points to be tested of the sub-equipment to be tested, and simulation operation data and expected data corresponding to the function points to be tested; sequentially traversing each functional point to be tested, processing the simulation operation data corresponding to the current functional point to be tested according to the real data flow process of the current functional point to be tested, and taking the data obtained from the end point of the data flow as the data to be verified; and comparing the data to be verified with the expected data to determine whether the current functional point to be tested is normal. The method comprises the steps of simulating the sub-equipment to be tested by the control sub-equipment development board, simulating the operation of distribution network, gateway control and the like of real sub-equipment by acquiring the function points to be tested of the sub-equipment to be tested, and the simulated operation data and the expected data corresponding to the function points to be tested, so that the automatic test of the function points to be tested of the sub-equipment to be tested is realized, and the efficiency of the function test of the sub-equipment is effectively improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a flowchart of a method for testing a function of a sub-device according to an embodiment of the present disclosure;
FIG. 2 is a schematic structural diagram of a functional testing apparatus for a sub-device according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a computer device provided according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clearly understood, the present application is described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments provided in the present application without any inventive step are within the scope of protection of the present application.
It is obvious that the drawings in the following description are only examples or embodiments of the application, and that it is also possible for a person skilled in the art to apply the application to other similar contexts on the basis of these drawings without inventive effort. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of ordinary skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments without conflict.
Unless defined otherwise, technical or scientific terms referred to herein shall have the ordinary meaning as understood by those of ordinary skill in the art to which this application belongs. Reference to "a," "an," "the," and similar words throughout this application are not to be construed as limiting in number, and may refer to the singular or the plural. The present application is directed to the use of the terms "including," "comprising," "having," and any variations thereof, which are intended to cover non-exclusive inclusions; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to only those steps or elements but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. Reference to "connected," "coupled," and the like in this application is not intended to be limited to physical or mechanical connections, but rather can include electrical connections, whether direct or indirect. The term "plurality" as used herein means two or more. "and/or" describes the association relationship of the associated object, indicating that there may be three relationships, for example, "a and/or B" may indicate: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. Reference herein to the terms "first," "second," "third," and the like, are merely to distinguish similar objects and do not denote a particular ordering for the objects.
The gateway in the present application refers to any gateway, and specifically may be an intelligent gateway or a common gateway. In the internet of things technology field, the terminal generally needs to realize the function of intelligent product through the gateway, and the intelligent product of docking with the gateway is exactly the subset in this application, and the type of subset is various, including intelligent lock, temperature and humidity sensor, temperature controller, four ways switch etc.. Because the program of the gateway can be updated continuously, after each update, before the gateway is put on line formally, the functions of the sub-equipment which is in butt joint with the gateway need to be tested, and whether the gateway can normally butt joint the functions of the sub-equipment is determined.
The embodiment provides a method for testing the function of a piece of sub-equipment, as shown in fig. 1, the method includes the following steps:
and step S110, controlling the sub-equipment development board to simulate the sub-equipment to be tested.
The sub-device development board is a set of hardware system, which comprises a CPU, a memory, an input device, an output device, a data path, an external resource interface and the like, and can simulate various types of sub-devices. The method includes the steps of simulating the sub-devices to be tested, namely simulating attributes, events, services and the like of the sub-devices to be tested. Specifically, the sub-device development board can be controlled to load the configuration information of the sub-device to be tested, so that the sub-device development board simulates the sub-device to be tested. The configuration information comprises information such as a product model, a product ID, a working mode ID, a cluster to which the configuration information belongs, a software version and the like. As one of the implementation manners, the configuration information of the sub-device to be tested may be stored in a configuration file, and the configuration file of the sub-device to be tested is sent to the sub-device development board, and the sub-device development board is controlled to analyze the configuration file, so as to obtain the configuration information of the sub-device to be tested, and thus, the sub-device to be tested is simulated.
And step S120, after the result that the sub-equipment development board successfully simulates the sub-equipment to be tested is obtained, controlling the sub-equipment development board and the gateway butted with the sub-equipment development board to enter a distribution network mode, and communicating protocol data between the sub-equipment development board and the gateway.
Specifically, the sub-device development board may be controlled to return a result of successful simulation or failed simulation after simulating the sub-device to be tested. If the sub-equipment development board successfully simulates the sub-equipment to be tested, subsequent operation can be carried out, and if the sub-equipment fails, positioning can be carried out according to the returned data, and the reason of the simulation failure is judged. Because the sub-device development board simulates the sub-device to be tested, and the sub-device to be tested and the gateway are usually butted through a protocol, such as a zigbee or bluetooth protocol, after the result that the sub-device development board successfully simulates the sub-device to be tested is obtained, the sub-device development board and the gateway butted with the sub-device development board need to be controlled to enter a distribution network mode, so that communication protocol data between the sub-device development board and the gateway are intercommunicated.
Step S130, after the sub-device development board and the gateway distribution network butted with the sub-device development board are successful, acquiring the function points to be tested of the sub-device to be tested, and the simulation operation data and the expected data corresponding to the function points to be tested.
After the sub-device development board and the gateway which is butted with the sub-device development board are successfully distributed, the communication between the sub-device development board and the gateway is indistinguishable from the normal communication between the sub-device to be tested and the gateway. Any one of the sub-devices to be tested has a corresponding function point to be tested, for example, for a temperature and humidity sensor, the function point to be tested includes switching on and off of the device, setting temperature, reporting temperature, returning to factory setting, adjusting wind speed, and the like. And for any one functional point to be tested, corresponding simulation operation data and expected data can be preset. For example, for this functional point of the switch device, the operation in the actual scene is that the terminal issues an on command or an off command to the gateway, the gateway receives the on command or the off command and then forwards the on command or the off command to the temperature and humidity sensor, and the temperature and humidity sensor performs actual feedback on the command (turns on the temperature and humidity sensor or turns off the temperature and humidity sensor). However, the sub-device development board only simulates the sub-device to be tested and cannot make real feedback, so in this embodiment, the on command or the off command may be encapsulated into simulation operation data and sent to the gateway, and after being processed by the gateway, the data that the sub-device development board should theoretically acquire is taken as expected data. As one of the implementation manners, the function point to be tested of each sub-device to be tested, and the simulated operation data and the expected data corresponding to the function point to be tested may be stored in different configuration files, and the function point to be tested of the sub-device to be tested, and the simulated operation data and the expected data corresponding to the function point to be tested may be obtained by loading the configuration file corresponding to the sub-device to be tested.
And step S140, sequentially traversing each function point to be tested, processing the simulation operation data corresponding to the current function point to be tested according to the real data flow process of the current function point to be tested, and taking the data obtained from the end point of the data flow as the data to be verified.
Specifically, since the real data flow flows of each function point are different, the simulation operation data corresponding to the current function point to be tested needs to be processed according to the real data flow of the current function point to be tested according to the specific requirements of each function point to be tested, and the data obtained at the end point of the data flow is used as the data to be verified. Taking the switch device of the temperature and humidity sensor as an example of the functional point to be tested, the real data flow process is that the operation command is forwarded to the temperature and humidity sensor by the gateway, and the end point of the data flow in the real data flow process is the temperature and humidity sensor, so that the end point of the data flow in this embodiment is the sub-device development board, and the data acquired by the sub-device development board is the data to be verified. Taking the reported temperature of the temperature and humidity sensor as an example of a functional point to be tested, the real data flow process is that the temperature reported by the temperature and humidity sensor is forwarded to the gateway and is forwarded and reported to the terminal through the gateway, the end point of the data flow in the real data flow process is the terminal, the data received by the terminal is the data processed by the gateway, and then the data processed by the gateway is taken as the data to be verified.
And S150, comparing the data to be verified with the expected data to determine whether the current functional point to be tested is normal.
By comparing the data to be verified and the expected data, whether the data processing of the current function point to be tested of the sub-device to be tested by the gateway is normal can be judged, so that whether the current function point to be tested is normal is determined. As one of the implementation manners, whether the data to be verified is consistent with the expected data or not can be judged, and if the data to be verified is consistent with the expected data, the current functional point to be tested is determined to be normal; and if the data to be verified is inconsistent with the expected data, determining that the current functional point to be tested is abnormal.
In the prior art, whether the functions of the sub-devices connected with the gateway in an abutting mode are normal or not is sequentially tested in a manual mode, however, the manual testing mode is too slow and the probability of misoperation is increased, so that the problem that the function efficiency of the sub-devices is too low in the prior art is caused.
In order to solve the problems, the application provides a function testing method of the sub-equipment, which simulates the sub-equipment to be tested by controlling a sub-equipment development board; after the result that the sub-equipment development board successfully simulates the sub-equipment to be tested is obtained, the sub-equipment development board and a gateway butted with the sub-equipment development board are controlled to enter a distribution network mode, so that communication protocol data are communicated between the sub-equipment development board and the gateway; after the sub-equipment development board and the gateway distribution network butted with the sub-equipment development board are successful, acquiring function points to be tested of the sub-equipment to be tested, and simulation operation data and expected data corresponding to the function points to be tested; sequentially traversing each functional point to be tested, processing the simulation operation data corresponding to the current functional point to be tested according to the real data flow process of the current functional point to be tested, and taking the data obtained from the end point of the data flow as the data to be verified; and comparing the data to be verified with the expected data to determine whether the current functional point to be tested is normal. The method comprises the steps of simulating the sub-equipment to be tested by the control sub-equipment development board, simulating the operation of distribution network, gateway control and the like of real sub-equipment by acquiring the function points to be tested of the sub-equipment to be tested, and the simulation operation data and the expected data corresponding to the function points to be tested, so that the automatic test of the function points to be tested of the sub-equipment to be tested is realized, and the efficiency of the function test of the sub-equipment is effectively improved.
Further, in one embodiment, in the step S140, the step of processing the simulation operation data corresponding to the current function point to be tested according to a real data flow process of the current function point to be tested, and using data obtained from an end point of the data flow as data to be verified includes the following steps:
step S141, determining whether the trigger source of the current function point to be tested is a gateway.
And S142, if so, sending the simulation operation data of the current functional point to be tested to the gateway, sending the data subjected to the gateway logic processing to the sub-equipment development board, and finally taking the data received by the sub-equipment development board as the data to be verified.
Specifically, whether the trigger source of the current functional point to be tested is the gateway or not is judged, that is, whether the functional point to be tested needs to send data to the sub-device to be tested through the gateway or not is judged, and if the data needs to be sent to the sub-device to be tested through the gateway, it is indicated that the trigger source of the functional point to be tested is the gateway. Taking a temperature and humidity sensor as an example of the sub-device to be tested, taking the function point of setting temperature as a test function point, setting temperature requires the gateway to issue an operation command to the temperature and humidity sensor, and then the trigger source of the function point of setting temperature is the gateway. If the data do not need to be sent to the sub-device to be tested through the gateway, it is indicated that the trigger source of the functional point to be tested is not the gateway. Taking a temperature and humidity sensor as an example of a to-be-tested sub-device, taking the function point of reporting temperature as a test function point, reporting temperature requires the temperature and humidity sensor to report current temperature to a gateway, and does not require the gateway to issue data to the to-be-tested sub-device, and a trigger source of the function point of reporting temperature is not the gateway. In an actual scenario, if the trigger source of the current function point to be tested is not a gateway, the trigger source of the current function point to be tested may be a sub-device to be tested, so in this embodiment, if the trigger source of the current function point to be tested is not a gateway, the trigger source of the current function point to be tested may be a sub-device development board. In addition, in order to simulate a real data stream transfer process, if the trigger source of the current function point to be tested is a gateway, after the simulation operation data of the current function point to be tested is sent to the gateway, the data processed by the gateway logic needs to be converted into protocol data in butt joint with the sub-device to be tested, and the protocol data is sent to a sub-device development board, such as zigbee or bluetooth protocol data. As one of the implementation manners, the trigger source of each function point to be tested of the sub-device to be tested can be marked in the configuration file storing the function point to be tested of the sub-device to be tested, and the simulation operation data and the expected data corresponding to the function point to be tested, so that the test efficiency of the current function point is effectively improved.
If the trigger source of the current functional point to be tested is the gateway, in order to simulate a real gateway processing flow, the simulation operation data of the current functional point to be tested is sent to the gateway, the gateway converts the simulation operation data into protocol data which is in butt joint with the sub-equipment development board and sends the protocol data to the sub-equipment development board, and finally the data received by the sub-equipment development board is used as data to be verified.
In one embodiment, in the step S140, the step of processing the simulation operation data corresponding to the current functional point to be tested according to the real data flow process of the current functional point to be tested, and using the data obtained from the end point of the data flow as the data to be verified further includes the following steps:
step S143, judging whether the trigger source of the current functional point to be tested is a sub-equipment development board;
and step S144, if yes, sending the simulation operation data of the current functional point to be tested to the sub-equipment development board, controlling the sub-equipment development board to convert the simulation operation data into protocol data in butt joint with the gateway, forwarding the protocol data to the gateway, and finally taking the data subjected to logic processing by the gateway as data to be verified.
Specifically, if the trigger source of the current functional point to be tested is determined to be the sub-device development board, the simulation operation data of the current functional point to be tested is sent to the sub-device development board, the sub-device development board is controlled to convert the simulation operation data into protocol data in butt joint with the gateway and transmit the protocol data to the gateway, the gateway processes the protocol data into a data format in butt joint with the terminal, and finally the data processed by the gateway is used as data to be verified so as to simulate a real gateway processing flow.
In addition, if there are lots of sub-devices to be tested currently, after the testing of all the function points of the sub-devices to be tested currently is completed, the above steps are repeatedly executed to test the next sub-device to be tested, and the steps are repeated until all the function points to be tested of all the sub-devices to be tested are tested.
Fig. 2 is a schematic diagram of a functional test apparatus for a sub-device according to an embodiment of the present invention, and as shown in fig. 2, the apparatus includes an upper computer 21, a gateway 22, and a sub-device development board 23;
the upper computer 21 is connected with the gateway 22 through a network; the upper computer 21 is connected with the sub-equipment development board 23 through a serial port;
the upper computer 21 is used for controlling the sub-equipment development board 23 to simulate the sub-equipment to be tested. As one of the implementation manners, the configuration information of the sub-device to be tested may be stored in a configuration file, and the upper computer 21 loads the configuration file and sends the configuration file to the sub-device development board 23 through a serial port. After receiving the configuration file, the sub-device development board 23 parses the configuration file, loads the configuration information of the sub-device to be tested, restarts the sub-device development board 23 after the loading is completed, returns a loading result to the upper computer 21 after the restarting is completed, and the upper computer 21 confirms whether the sub-device development board 23 successfully simulates the sub-device to be tested according to the result returned by the sub-device development board 23. After obtaining the result that the sub-device development board 23 successfully simulates the sub-device to be tested, the upper computer 21 controls the sub-device development board 23 and the gateway 22 butted with the sub-device development board 23 to enter a distribution network mode, so that communication protocol data between the sub-device development board 23 and the gateway 22 are communicated; after the network distribution of the sub-device development board 23 and the gateway 22 butted with the sub-device development board is successful, the upper computer 21 obtains a function point to be tested of the sub-device to be tested, and simulation operation data and expected data corresponding to the function point to be tested; the upper computer 21 sequentially traverses each function point to be tested, processes the simulation operation data corresponding to the current function point to be tested according to the real data flow process of the current function point to be tested, and takes the data obtained from the end point of the data flow as the data to be verified; and comparing the data to be verified with the expected data to determine whether the current functional point to be tested is normal.
The function testing device 20 of the sub-device simulates the sub-device to be tested by controlling the sub-device development board 23 through the upper computer 21, and obtains the function points to be tested of the sub-device to be tested, the simulation operation data and the expected data corresponding to the function points to be tested through the upper computer 21 to simulate the operation of distribution network and gateway control and the like of the real sub-device, so that the automatic testing of the function points to be tested of the sub-device to be tested is realized, and the efficiency of the function testing of the sub-device is effectively improved.
In one embodiment, the upper computer 21 is further configured to control the sub-device development board 23 to load configuration information of the sub-devices to be tested, so that the sub-device development board 23 simulates the sub-devices to be tested.
In one embodiment, the upper computer 21 is further configured to send a configuration file of the sub-device to be tested to the sub-device development board 23; the configuration file records the configuration information of the sub-equipment to be tested; the control sub-device development board 23 parses the configuration file to obtain the configuration information of the sub-device to be tested.
In one embodiment, the upper computer 21 is further configured to determine whether a trigger source of the current function point to be tested is a gateway; if yes, sending the simulation operation data of the current functional point to be tested to the gateway 22, sending the data subjected to logic processing by the gateway 22 to the sub-device development board 23, and finally taking the data received by the sub-device development board 23 as the data to be verified.
In one embodiment, the upper computer 21 is further configured to determine whether the trigger source of the current function point to be tested is the sub-device development board 23, if yes, send the simulation operation data of the current function point to be tested to the sub-device development board 23, control the sub-device development board 23 to convert the simulation operation data into protocol data in butt joint with the gateway 22, and forward the protocol data to the gateway 22, and finally use the data logically processed by the gateway 22 as data to be verified.
In one embodiment, the upper computer 21 is further configured to compare the data to be verified with the expected data, and determine whether the data to be verified and the expected data are consistent; if the data to be verified is consistent with the expected data, determining that the current functional point to be tested is normal; and if the data to be verified is inconsistent with the expected data, determining that the current functional point to be tested is abnormal.
The above modules may be functional modules or program modules, and may be implemented by software or hardware. The modules can be embedded in a hardware form or independent of a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 3. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The memory provides an environment for the operating system and the computer programs to run in the non-volatile storage medium. The database of the computer device is used for storing a preset configuration information set. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of functional testing of a sub-device.
In one embodiment, a computer device is provided, which may be a terminal. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The memory provides an environment for the operating system and the running of computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of functional testing of a sub-apparatus. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the configuration shown in fig. 3 is a block diagram of only a portion of the configuration associated with the present application, and is not intended to limit the computing device to which the present application may be applied, and that a particular computing device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
the control sub-equipment development board simulates the sub-equipment to be tested;
after the result that the sub-equipment development board successfully simulates the sub-equipment to be tested is obtained, the sub-equipment development board and the gateway butted with the sub-equipment development board are controlled to enter a distribution network mode, so that communication protocol data are communicated between the sub-equipment development board and the gateway;
after the child device development board and the gateway distribution network butted with the child device development board are successful, acquiring function points to be tested of the child device to be tested, and simulation operation data and expected data corresponding to the function points to be tested;
sequentially traversing each functional point to be tested, processing the simulation operation data corresponding to the current functional point to be tested according to the real data flow process of the current functional point to be tested, and taking the data obtained from the end point of the data flow as the data to be verified;
and comparing the data to be verified with the expected data to determine whether the current functional point to be tested is normal.
In one embodiment, the processor when executing the computer program further performs the steps of:
and controlling the sub-equipment development board to load the configuration information of the sub-equipment to be tested, so that the sub-equipment development board simulates the sub-equipment to be tested.
In one embodiment, before the controlling sub-device developing board loads the configuration information of the sub-device to be tested, the processor when executing the computer program further realizes the following steps:
sending the configuration file of the sub-equipment to be tested to the sub-equipment development board; the configuration file records the configuration information of the sub-equipment to be tested;
and the control sub-equipment development board analyzes the configuration file to obtain the configuration information of the sub-equipment to be tested.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
judging whether a trigger source of the current functional point to be tested is a gateway or not;
if so, sending the simulation operation data of the current functional point to be tested to the gateway, sending the data subjected to the gateway logic processing to the sub-equipment development board, and finally taking the data received by the sub-equipment development board as the data to be verified.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
judging whether a trigger source of the current to-be-tested function point is a sub-equipment development board or not;
if so, sending the simulation operation data of the current functional point to be tested to the sub-equipment development board, controlling the sub-equipment development board to convert the simulation operation data into protocol data in butt joint with the gateway, forwarding the protocol data to the gateway, and finally taking the data subjected to logic processing by the gateway as data to be verified.
In one embodiment, the processor when executing the computer program further performs the steps of:
comparing the data to be verified with expected data, and judging whether the data to be verified is consistent with the expected data;
if the data to be verified is consistent with the expected data, determining that the current functional point to be tested is normal;
and if the data to be verified is inconsistent with the expected data, determining that the current functional point to be tested is abnormal.
According to the storage medium, the sub-equipment to be tested is simulated by controlling the sub-equipment development board, the distribution network, the gateway control and other operations of the real sub-equipment are simulated by acquiring the function points to be tested of the sub-equipment to be tested, and the simulated operation data and the expected data corresponding to the function points to be tested, so that the automatic test of the function points to be tested of the sub-equipment to be tested is realized, and the function test efficiency of the sub-equipment is effectively improved.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, carries out the steps in the method embodiments described above.
It should be noted that, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party.
It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to be limiting. All other embodiments, which can be derived by a person skilled in the art from the examples provided herein without any inventive step, shall fall within the scope of protection of the present application.
It is obvious that the drawings are only examples or embodiments of the present application, and it is obvious to those skilled in the art that the present application can be applied to other similar cases according to the drawings without creative efforts. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
The term "embodiment" is used herein to mean that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is to be expressly or implicitly understood by one of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the patent protection. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

1. A method for functional testing of a sub-apparatus, the method comprising the steps of:
the control sub-equipment development board simulates the sub-equipment to be tested;
after a result that the sub-equipment development board successfully simulates the sub-equipment to be tested is obtained, the sub-equipment development board and a gateway butted with the sub-equipment development board are controlled to enter a distribution network mode, so that communication protocol data are communicated between the sub-equipment development board and the gateway;
after the sub-equipment development board and the gateway distribution network butted with the sub-equipment development board are successful, acquiring function points to be tested of the sub-equipment to be tested, and simulation operation data and expected data corresponding to the function points to be tested;
sequentially traversing each functional point to be tested, processing the simulation operation data corresponding to the current functional point to be tested according to the real data flow process of the current functional point to be tested, and taking the data obtained from the end point of data flow as the data to be verified;
and comparing the data to be verified with the expected data to determine whether the current functional point to be tested is normal.
2. The functional test method of the sub-device according to claim 1, wherein the control sub-device development board simulates the sub-device to be tested, comprising the steps of:
and controlling the sub-equipment development board to load the configuration information of the sub-equipment to be tested, so that the sub-equipment development board simulates the sub-equipment to be tested.
3. The method for functional testing of a kid device of claim 2, wherein before the controlling the kid device development board to load the configuration information of the kid device under test, the method further comprises:
sending the configuration file of the sub-equipment to be tested to the sub-equipment development board; the configuration file records the configuration information of the sub-equipment to be tested;
and controlling the sub-equipment development board to analyze the configuration file to acquire the configuration information of the sub-equipment to be tested.
4. The method for testing functions of a sub-device according to claim 1, wherein the step of processing the simulation operation data of the current functional point to be tested according to a real data flow process of the current functional point to be tested, and taking data obtained from an end point of a data flow as data to be verified comprises the following steps:
judging whether the trigger source of the current functional point to be tested is the gateway;
if so, sending the simulation operation data of the current functional point to be tested to the gateway, sending the data subjected to the logic processing of the gateway to the sub-equipment development board, and finally taking the data received by the sub-equipment development board as the data to be verified.
5. The functional test method of a sub-device according to claim 1, characterized in that the method further comprises:
judging whether the trigger source of the current functional point to be tested is the sub-equipment development board or not;
if yes, sending the simulation operation data of the current functional point to be tested to the sub-equipment development board, controlling the sub-equipment development board to convert the simulation operation data into protocol data in butt joint with the gateway, forwarding the protocol data to the gateway, and finally taking the data subjected to logic processing of the gateway as the data to be verified.
6. The method for testing the functions of the sub-equipment according to claim 1, wherein the step of comparing the data to be verified with the expected data to determine whether the current functional point to be tested is normal comprises the following steps:
comparing the data to be verified with the expected data, and judging whether the data to be verified and the expected data are consistent;
if the data to be verified is consistent with the expected data, determining that the current functional point to be tested is normal;
and if the data to be verified is inconsistent with the expected data, determining that the current functional point to be tested is abnormal.
7. The functional test device of the sub-equipment is characterized by comprising an upper computer, a gateway and a sub-equipment development board;
the upper computer is connected with the gateway through a network; the upper computer is connected with the sub-equipment development board through a serial port;
the upper computer is used for executing the steps of the method of any one of claims 1 to 6.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
CN202210950439.5A 2022-08-09 2022-08-09 Function test method and device of sub-equipment, computer equipment and storage medium Active CN115426297B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210950439.5A CN115426297B (en) 2022-08-09 2022-08-09 Function test method and device of sub-equipment, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210950439.5A CN115426297B (en) 2022-08-09 2022-08-09 Function test method and device of sub-equipment, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115426297A true CN115426297A (en) 2022-12-02
CN115426297B CN115426297B (en) 2023-12-12

Family

ID=84196840

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210950439.5A Active CN115426297B (en) 2022-08-09 2022-08-09 Function test method and device of sub-equipment, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115426297B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160105810A1 (en) * 2014-10-14 2016-04-14 Rohde & Schwarz Asia Pte. Ltd. Technique for testing wireless network load produced by mobile app-carrying devices
CN105515911A (en) * 2015-12-21 2016-04-20 惠州市德赛西威汽车电子股份有限公司 Gateway automatic test system and method of CAN network
CN105608005A (en) * 2015-12-23 2016-05-25 深圳创维-Rgb电子有限公司 Television system test method and system
CN109147459A (en) * 2018-10-30 2019-01-04 重庆房地产职业学院 Smart home simulated environment experiment teaching system based on Internet of Things
CN111413103A (en) * 2019-01-07 2020-07-14 上汽通用汽车有限公司 Automatic test system and test method for vehicle working condition
CN112988572A (en) * 2021-02-09 2021-06-18 中国工商银行股份有限公司 Multi-environment multi-channel multi-version simulation test method and device
CN114157761A (en) * 2021-12-10 2022-03-08 四川天邑康和通信股份有限公司 System and method for voice test of multi-channel voice gateway equipment based on router
CN114172835A (en) * 2021-11-24 2022-03-11 重庆长安汽车股份有限公司 Automatic testing method of Bluetooth digital key
CN114328110A (en) * 2021-12-29 2022-04-12 天翼物联科技有限公司 Monitoring method, system and storage medium for gateway of Internet of things
CN114500351A (en) * 2022-02-09 2022-05-13 北京网测科技有限公司 Network performance test method, device, equipment and storage medium
US20220197782A1 (en) * 2019-09-16 2022-06-23 Shanghai Ncatest Technologies Co., Ltd. Offline debugging method
CN114780315A (en) * 2022-04-28 2022-07-22 中国银行股份有限公司 Hardware simulation test method and device
CN114817022A (en) * 2022-04-19 2022-07-29 中国铁道科学研究院集团有限公司电子计算技术研究所 Railway electronic payment platform test method, system, equipment and storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160105810A1 (en) * 2014-10-14 2016-04-14 Rohde & Schwarz Asia Pte. Ltd. Technique for testing wireless network load produced by mobile app-carrying devices
CN105515911A (en) * 2015-12-21 2016-04-20 惠州市德赛西威汽车电子股份有限公司 Gateway automatic test system and method of CAN network
CN105608005A (en) * 2015-12-23 2016-05-25 深圳创维-Rgb电子有限公司 Television system test method and system
CN109147459A (en) * 2018-10-30 2019-01-04 重庆房地产职业学院 Smart home simulated environment experiment teaching system based on Internet of Things
CN111413103A (en) * 2019-01-07 2020-07-14 上汽通用汽车有限公司 Automatic test system and test method for vehicle working condition
US20220197782A1 (en) * 2019-09-16 2022-06-23 Shanghai Ncatest Technologies Co., Ltd. Offline debugging method
CN112988572A (en) * 2021-02-09 2021-06-18 中国工商银行股份有限公司 Multi-environment multi-channel multi-version simulation test method and device
CN114172835A (en) * 2021-11-24 2022-03-11 重庆长安汽车股份有限公司 Automatic testing method of Bluetooth digital key
CN114157761A (en) * 2021-12-10 2022-03-08 四川天邑康和通信股份有限公司 System and method for voice test of multi-channel voice gateway equipment based on router
CN114328110A (en) * 2021-12-29 2022-04-12 天翼物联科技有限公司 Monitoring method, system and storage medium for gateway of Internet of things
CN114500351A (en) * 2022-02-09 2022-05-13 北京网测科技有限公司 Network performance test method, device, equipment and storage medium
CN114817022A (en) * 2022-04-19 2022-07-29 中国铁道科学研究院集团有限公司电子计算技术研究所 Railway electronic payment platform test method, system, equipment and storage medium
CN114780315A (en) * 2022-04-28 2022-07-22 中国银行股份有限公司 Hardware simulation test method and device

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
HONGWEI ZHAO;ZHIPING HUANG;YING MEI;: "High-Speed EMU TCMS Design and LCC Technology Research", ENGINEERING, no. 01 *
霍永强;林鑫岑;王胜雷;何威;: "智慧工厂信息采集节点组网能力测试平台设计", 计算机测量与控制, no. 04 *
黄胜龙;赵德银;周时莹;张东波;许中芳;: "汽车智能远程控制与整车控制功能仿真验证技术与方法", 汽车技术, no. 10 *

Also Published As

Publication number Publication date
CN115426297B (en) 2023-12-12

Similar Documents

Publication Publication Date Title
CN106067840B (en) Remote debugging method and system for on-orbit satellite
CN110659198A (en) Application program test case execution method and device and software test system
CN109857423A (en) Program version update method, device, server and readable storage medium storing program for executing
CN111400167A (en) Redfish service compliance verification method, device, equipment and medium
CN112328492A (en) Interaction control method and device between anchor and electronic equipment
CN115391219A (en) Test case generation method and device, electronic equipment and storage medium
CN110888800A (en) Service interaction function test method, device, storage medium and test system
CN107203471B (en) Joint debugging method, service platform and computer storage medium
CN115426297A (en) Function test method and device of sub-equipment, computer equipment and storage medium
CN115202949B (en) Chip signal monitoring device and method, computer equipment and storage medium
CN111400166A (en) Real-time communication service testing method, device and system and electronic equipment
CN113254062B (en) Method, device, equipment and medium for configuring and taking effect of BMC (baseboard management controller) parameters
CN115437865A (en) Method, device, equipment and medium for testing abnormal power failure of hard disk
CN114116343A (en) Equipment testing method and device, electronic equipment and storage medium
CN114095343A (en) Disaster recovery method, device, equipment and storage medium based on double-active system
CN114461337A (en) Cloud simulation system and method, electronic equipment and storage medium
CN114721286A (en) Distributed compiled parallel real-time simulation system and simulation method
CN111464398A (en) Self-organizing centreless network high-level protocol testing method, equipment and storage medium
CN113760750B (en) Intelligent device testing method and device, electronic device and storage medium
CN115996410B (en) Method, device, equipment and storage medium for testing wireless communication protocol stack
CN112069051A (en) PUSH time-consuming testing method and terminal
CN116954942B (en) Interface calling method, device, vehicle and storage medium
KR102326608B1 (en) Apparaus and method for checking mobile application based on robotic process automation
CN117370209A (en) Application program performance test method, device, medium and electronic equipment
CN112468541A (en) Data processing method, device and system based on Internet of things

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
GR01 Patent grant
GR01 Patent grant