TBOX log function test method and device, electronic equipment and storage medium
By triggering the target event in TBOX and recording the moment, obtaining and verifying the correctness of the log, the automation problem of TBOX log function test is solved, efficient and accurate log testing is achieved, and the integrity and reliability of TBOX log information is ensured.
Patent Information
- Application Number
- CN202510513919.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, the testing of TBOX log function lacks automation means, resulting in inefficient testing and it is difficult to ensure the time accuracy and content accuracy of log information.
By controlling TBOX to trigger the target event, recording the control time, obtaining and verifying the correctness of the target log, it realizes an automated test process, including testing of various events such as network status, time calibration success, dialing, and device status.
It realizes automated testing of TBOX logging function, improves testing efficiency, ensures the accuracy and completeness of log information, saves manpower, and checks the reliability of the log module through stress tests.
Smart Images

Figure CN120416098A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of testing technologies, and in particular, to a method, device, electronic device, and storage medium for testing the TBOX log function. Background Art
[0002] The in-vehicle communication box (Telematics-Box, abbreviated as T-Box) is an important in-vehicle component for realizing the Internet of Vehicles. It has evolved from the initial single function of collecting vehicle information to gradually developing into multiple functions such as vehicle information monitoring, interaction, and remote control. Among them, the remote control function includes more than a dozen sub-functions such as scheduled charging, remote opening of the trunk, remote steering wheel heating, and seat heating.
[0003] In order to ensure the reliability of various functions of the T-Box, it is necessary to perform various function tests on the T-Box. In the function test of the TBOX, the maintenance test log is a log that each TBOX must record. The maintenance test log records the information of each event that occurs. To ensure that it is convenient to troubleshoot problems in subsequent test work, the time accuracy and content accuracy of the maintenance test log are extremely important.
[0004] In view of this, this application is specifically proposed. Summary of the Invention
[0005] This application aims to provide a method, device, electronic device, and storage medium for testing the TBOX log function, which realizes the automated test for the TBOX log function.
[0006] In a first aspect, an embodiment of this application provides a method for testing the TBOX log function, including: Controlling the TBOX to trigger a target event and recording the control moment; Obtaining the target log generated by the TBOX according to the target event; Verifying the correctness of the target log according to the control moment and the target event; If it is determined that the target log is correct, it is determined that the test for the TBOX log function passes.
[0007] According to the technical solution provided by the embodiment of this application, optionally, the number of the target events is multiple, and the controlling the TBOX to trigger a target event and recording the control moment includes: Controlling the TBOX to trigger each target event in sequence and respectively recording the control moments when the TBOX triggers each target event; The obtaining the target log generated by the TBOX according to the target event includes: After all the target events are triggered in sequence, obtaining the target logs generated by the TBOX according to each target event respectively; If it is determined that the target log is correct, it is determined that the test for the TBOX log function passes, including: If it is determined that all target logs are correct, it is determined that the test for the TBOX log function passes.
[0008] According to the technical solution provided by the embodiment of the present application, optionally, the target events include network status events, time calibration success events, dialing events, and device status events; Controlling the TBOX to trigger a target event and recording the control moment includes: Controlling the programmable power supply to be connected to the first power supply terminal of the TBOX, and recording the moment when the programmable power supply is connected to the first power supply terminal of the TBOX, to power on the TBOX, so as to trigger the network status event, time calibration success event, dialing event, and device status event.
[0009] According to the technical solution provided by the embodiment of the present application, optionally, the target event further includes a signal gear position status event, and controlling the TBOX to trigger a target event and recording the control moment further includes: Controlling the shielding box to close, and recording the moment when the shielding box is closed, so that the TBOX is in a weak network environment. After waiting for a first duration, controlling the shielding box to open, so that the TBOX triggers a signal gear position status event, where the TBOX is located inside the shielding box, and the weak network environment refers to an environment where the communication metrics do not meet the preset requirements, and the communication metrics include one or more of bandwidth, signal strength, packet loss rate, and delay time.
[0010] According to the technical solution provided by the embodiment of the present application, optionally, the target events further include a sleep event and a wake-up event, and controlling the TBOX to trigger a target event and recording the control moment further includes: Controlling the programmable power supply to be disconnected from the second power supply terminal of the TBOX, so that the TBOX enters the sleep state to trigger the sleep event; When it is detected that the working current of the TBOX is less than the current threshold, record the current moment, and wait for a second duration, then control the programmable power supply to be connected to the second power supply terminal of the TBOX to trigger the wake-up event.
[0011] According to the technical solution provided by the embodiment of the present application, optionally, the target events further include an emergency call event, a minimum data set sending event, and a short message receiving event, and controlling the TBOX to trigger a target event and recording the control moment further includes: Controlling the relay to be connected to the emergency call button of the TBOX, simulating that the emergency call button is pressed, and recording the pressing moment, so that the TBOX triggers the emergency call event and the minimum data set sending event; After waiting for the third time period, control the program-controlled power supply to disconnect from the second power supply terminal of the TBOX, put the TBOX into the sleep state, and simulate sending a remote control command to the service platform through the mobile terminal to cause the TBOX to trigger a short message receiving event. When the service platform receives the remote control command, it sends a short message to the TBOX to wake up the TBOX through the short message. When the TBOX receives the short message, it enters the wake-up state and triggers a short message receiving event.
[0012] According to the technical solution provided by the embodiment of the present application, optionally, the verifying the correctness of the target log according to the control moment and the target event includes: Determine an event field according to the target event; Search for the event field in the target log. If the event field exists in the target log and the time difference between the time information associated with the event field and the control moment is within a set range, it is determined that the target log is correct.
[0013] According to the technical solution provided by the embodiment of the present application, optionally, the controlling the TBOX to trigger a target event and recording the control moment includes: Control the TBOX to trigger the target event at a preset frequency and record the control moment until the number of times the TBOX is controlled to trigger the target event reaches the number threshold.
[0014] In a second aspect, an embodiment of the present application further provides a test device for the TBOX log function, including: A control module, configured to control the TBOX to trigger a target event and record the control moment; An acquisition module, configured to acquire a target log generated by the TBOX according to the target event; A verification module, configured to verify the correctness of the target log according to the control moment and the target event; A determination module, configured to determine that the test for the TBOX log function passes if it is determined that the target log is correct.
[0015] In a third aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes: A processor and a memory; The processor is configured to execute the steps of the test method for the TBOX log function as described in any one of the embodiments by calling a program or instruction stored in the memory.
[0016] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores a program or instruction, and the program or instruction causes a computer to execute the steps of the test method for the TBOX log function as described in any one of the embodiments.
[0017] In summary, the present application proposes a test method for the TBOX log function, which controls the TBOX to trigger a target event and records the control moment; obtains the target log generated by the TBOX according to the target event; verifies the correctness of the target log according to the control moment and the target event; if it is determined that the target log is correct, it is determined that the test for the TBOX log function passes. The technical means provides an automated test process for the TBOX log function and realizes the automated test of the TBOX log function. Description of the Drawings
[0018] Figure 1 is a flowchart of a test method for the TBOX log function provided by an embodiment of the present application; Figure 2 is a schematic structural diagram of a test device for the TBOX log function provided by an embodiment of the present application; Figure 3 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed Embodiments
[0019] The present application will be further described in detail below with reference to the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related invention and are not intended to limit the invention. Additionally, it should be noted that for the sake of description, only the parts related to the invention are shown in the drawings.
[0020] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the drawings and embodiments.
[0021] Figure 1 is a flowchart of a test method for the TBOX log function provided by an embodiment of the present application. Refer to Figure 1 , the test method for the TBOX log function specifically includes the following steps: S110. Control the TBOX to trigger a target event and record the control moment.
[0022] Among them, the target event includes one or more of a network status event, a time calibration success event, a dialing event, a device status event, a signal gear status event, a sleep event, a wake-up event, an emergency call event, a minimum data set sending event, and a short message receiving event.
[0023] The network status event specifically refers to the event that the network signal is restored after the TBOX is powered on or the network signal is lost after the TBOX is powered off. The time calibration success event means that after the TBOX is powered on, it needs to synchronize with the standard time source to ensure the accuracy of the recorded time. After being powered on, the TBOX will start the time calibration operation. When the time calibration is completed and the time synchronization is successful, a time calibration success event is generated. The dialing event means that after the TBOX is powered on, it performs a dialing operation according to the preset configuration. The generation of the dialing event indicates state changes such as the start, success, or failure of the dialing process. The device status event means that after the TBOX is powered on, it initializes and self-checks its various modules (such as the Bluetooth module, GPS module, 4G module, etc.). The device status event is used to reflect the status information of these modules, such as whether a certain module starts normally and whether there are any faults. Through the device status event, the vehicle control system or the background management system can timely understand the working status of the TBOX. The signal gear status event represents the signal strength level of the TBOX. For example, when the TBOX is placed in a shielding box and the shielding box is closed, the TBOX is in a weak network environment and the signal strength level of the TBOX is low. When the shielding box is opened, the signal strength level of the TBOX increases. When the signal strength of the TBOX changes, a signal gear status event is triggered.
[0024] The sleep event refers to the event triggered when the TBOX enters the sleep state. The wake-up event refers to the event triggered when the TBOX is awakened. The emergency call event and the minimum data set sending event refer to the events triggered when the emergency call button of the TBOX is pressed, which are used to call the emergency center and send the minimum data set (including information such as the vehicle's position and speed). The short message reception event refers to the event triggered when the TBOX receives a remote control instruction sent by the service platform. For example, when the service platform sends a remote instruction to start the vehicle, the vehicle will inform the user by short message after the start is completed.
[0025] Before starting the test, arrange the test environment, including arranging the TBOX to be tested, the programmable power supply, and the shielding box, and ensure that all components can work normally.
[0026] In some embodiments, the target events include network status events, time calibration success events, dialing events, and device status events; controlling the TBOX to trigger the target events and recording the control moment includes: Controlling the programmable power supply to be connected to the first power supply terminal of the TBOX through a script, and recording the moment when the programmable power supply is connected to the first power supply terminal of the TBOX, so that the TBOX is powered on to trigger the network status event, time calibration success event, dialing event, and device status event.
[0027] In some embodiments, the target events further include signal gear status events, and controlling the TBOX to trigger the target events and recording the control moment further includes: Control the shielding box to close through a script, and record the moment when the shielding box is controlled to close, so that the TBOX is in a weak network environment. After waiting for the first duration, control the shielding box to open, so that the TBOX triggers a signal gear state event, where the TBOX is located inside the shielding box. The purpose of waiting for the first duration is to make the TBOX stay in a weak network environment for a certain period of time to ensure that the signal of the TBOX changes, thereby improving the reliability of the test environment and ultimately improving the test accuracy. A shielding box (ShieldingBox) is a device used to isolate electromagnetic signals, reduce the impact of external electromagnetic interference on the devices inside the shielding box, or prevent the electromagnetic radiation of the internal devices from leaking into the external environment. Its core principle is to use a closed shell made of metal materials (such as copper, aluminum, stainless steel, etc.) to block the propagation path of electromagnetic waves through the electromagnetic shielding effect, thereby achieving the isolation of the electromagnetic field. The weak network environment refers to an environment where the communication indicators do not meet the preset requirements, and the communication indicators include one or more of bandwidth, signal strength, packet loss rate, and delay time. For example, when the bandwidth in the environment is lower than 1 Mbps, it is considered a weak network environment; when the signal strength is less than -90 dBm, it is considered a weak network environment. Generally speaking, a weak network environment refers to a network state with poor network signal quality, low transmission rate, high delay, and high packet loss rate, usually manifested as unstable or limited data transmission. Generally, the basement is a weak network environment.
[0028] In some embodiments, the target event further includes a sleep event and a wake-up event. Controlling the TBOX to trigger the target event and recording the control moment further includes: Control the program-controlled power supply to disconnect from the second power supply terminal of the TBOX through a script, so that the TBOX enters the sleep state to trigger the sleep event; when it is detected that the working current of the TBOX is less than the current threshold (which indicates that the TBOX has entered the sleep state at this time), record the current moment, and wait for the second duration before controlling the program-controlled power supply to connect to the second power supply terminal of the TBOX to trigger the wake-up event. The purpose of waiting for the second duration is to ensure that the TBOX is completely asleep, thereby improving the reliability of the test environment and improving the test accuracy.
[0029] In some embodiments, the target events further include an emergency call event, a minimum data set sending event, and a short message receiving event. The control TBOX triggers the target events and records the control moment, and further includes: connecting a relay to the emergency call button of the TBOX through a script to simulate the pressing of the emergency call button, and recording the pressing moment, so that the TBOX triggers the emergency call event and the minimum data set sending event; after waiting for a third duration, disconnecting the programmable power supply from the second power supply terminal of the TBOX through a script to put the TBOX into a sleep state, and simulating sending a remote control command from a mobile terminal to a service platform, so that the TBOX triggers the short message receiving event. Wherein, when the service platform receives the remote control command, it sends a short message to the TBOX to wake up the TBOX through the short message. When the TBOX receives the short message, it enters the wake-up state and triggers the short message receiving event.
[0030] S120. Obtain the target log generated by the TBOX according to the target event.
[0031] Specifically, obtain the target log corresponding to the target event from the log storage path of the TBOX through a script.
[0032] S130. Verify the correctness of the target log according to the control moment and the target event.
[0033] Exemplarily, the verifying the correctness of the target log according to the control moment and the target event includes: Determine the event field according to the target event; search for the event field in the target log. If the event field exists in the target log and the time difference between the time information associated with the event field and the control moment is within a set range, it is determined that the target log is correct. For example, when the target event is a sleep event, the event field may be "sleep"; when the target event is a wake-up event, the event field may be "wake-up", etc. Generally speaking, the event field is used to represent the event content of the target event, and can be understood as a summary or conclusion of the event content of the target event.
[0034] In the target log, more detailed events and the occurrence moments of the events will be recorded. By identifying whether the event information recorded in the target log is consistent with the expected event information, and whether the occurrence moment of the event information is consistent with the expected occurrence moment, it is determined whether the log function of the TBOX is normal.
[0035] In some embodiments, the tests are conducted in the following event sequence: network status event, time calibration success event, dialing event, device status event, signal gear status event, sleep event, wake-up event, emergency call event, minimum data set transmission event, and SMS reception event. Start the test: Run the test case testcase in the Python script. The first part of testcase is to control the programmable power supply, shielding box, and relay to trigger the generation of corresponding target events. After the test starts, the script controls the programmable power supply to connect to the first power supply terminal of the TBOX, powers on the TBOX, and records the time information. After powering on the TBOX, wait for 3 minutes to wait for the TBOX to successfully camp on the network. By controlling the connection to the first power supply terminal, network status events, time calibration success events, dialing events, and device status events can be triggered. Next, the script controls the shielding box to close, weakens the TBOX signal to be in a weak network environment, and records the time information. After waiting for 1 minute, control the shielding box to open. By controlling the opening or closing of the shielding box, signal gear status events can be triggered. Then, the script controls the programmable power supply to disconnect the connection with the second power supply terminal, puts the TBOX into the sleep state, records the current time information when the current of the TBOX is detected to be less than 3 mA, and after waiting for 30 s, controls the programmable power supply to connect to the second power supply terminal to wake up the TBOX into the working state. By controlling the disconnection and connection of the second power supply terminal, the logs of sleep events and wake-up events can be triggered. After the TBOX enters the normal working state, the script controls the relay to connect to the ECALL button, simulates the pressing of the ECALL button, the TBOX makes a normal emergency call, and automatically sends the MSD information. By controlling the trigger of ECALL, the logs of emergency call events and minimum data set transmission events can be triggered. Wait for 5 minutes. After the TBOX exits the ECALL state, the script first controls the programmable power supply to disconnect the connection with the second power supply terminal to put the TBOX into the sleep state, and then the script simulates the mobile phone sending a request command for remotely controlling the door lock to the service platform TSP. After receiving it, TSP sends an SMS to wake up the TBOX. After the TBOX receives the SMS, it enters the wake-up state. By controlling the method of sending the remote control instruction, the log of the SMS reception event can be triggered.
[0036] After all events are triggered and the time points are recorded, use the subprocess module in Python to execute the cd command in PowerShell to change the working directory to the log storage path, and then execute the adb pull command to pull the log files within the time points from the board to the local. The script automatically reads the log content and finds the fields corresponding to the relevant events. If there is no corresponding event log, the test result for this test item is "failed". If there is a corresponding event log and the time difference from the time recorded when the event was triggered is less than 5s, the test result for this test item is "passed". Among them, the subprocess module is a standard library module in Python. With the help of this module, external commands can be executed in Python scripts. The cd command is used to change the working directory. It is necessary to execute the cd command in the PowerShell environment to change the current working directory to the log storage path for accurate log pulling. ADB is a general command-line tool that enables communication between different devices. The adb pull command is used to copy the logs on the TBOX to the host computer.
[0037] Generally, the number of the target events is multiple. Controlling the TBOX to trigger the target events and recording the control moment includes: Controlling the TBOX to trigger each target event in sequence and respectively recording the control moment when the TBOX triggers each target event.
[0038] Obtaining the target logs generated by the TBOX according to the target events includes: After all target events are triggered in sequence, obtaining the target logs generated by the TBOX according to each target event respectively.
[0039] If it is determined that the target logs are correct, then determining that the test for the TBOX log function passes includes: If it is determined that all target logs are correct, then determining that the test for the TBOX log function passes.
[0040] In some embodiments, a long-term stress test can be performed on a log event of the TBOX. Taking the sleep event and wake-up event as examples: Set the number of stress test times and start the test. Set the second power supply terminal of the TBOX to be connected to the programmable power supply. Through a for loop for counting, control the disconnection of the second power supply terminal of the TBOX from the programmable power supply, and after waiting for 30 s, control the connection of the second power supply terminal of the TBOX to the programmable power supply. Thus, one for loop is completed. Record the time information at each disconnection and connection in real time through a script. When the set number of test times is completed, execute the cd command in PowerShell through the subprocess module in Python to switch the working directory to the log storage path, and then execute the adb pull command to pull the log file within the recorded time points from the board side to the local. Automatically read the log content through a script and find the corresponding fields for sleep and wake-up. Check whether there are corresponding sleep and wake-up fields at each recorded time point. If not, determine that this test item fails. If corresponding sleep and wake-up fields are detected at each recorded time point and the difference between the time and the time recorded when the event is triggered is less than 5 s, determine that this test item passes.
[0041] Generally speaking, controlling the TBOX to trigger a target event and recording the control moment includes: Controlling the TBOX to trigger a target event at a preset frequency and recording the control moment until the number of times the TBOX triggers the target event reaches the number threshold.
[0042] The test method for the TBOX log function provided by the embodiments of the present application controls the TBOX to trigger a target event and records the control moment; obtains the target log generated by the TBOX according to the target event; verifies the correctness of the target log according to the control moment and the target event; if it is determined that the target log is correct, determines that the test for the TBOX log function passes. The technical means provides an automated test process for the TBOX log function, realizes the automated test of the TBOX log function, saves manpower, and can use the stress test method to check whether there are omissions in the log module. Through long-term and multiple tests, the accuracy of the information recorded by the controller can be comprehensively checked.
[0043] Based on the above embodiments, Figure 2Provide a schematic structural diagram of a test device for the TBOX log function. The test device for the TBOX log function includes: a control module 210, configured to control the TBOX to trigger a target event and record the control time; an acquisition module 220, configured to acquire a target log generated by the TBOX according to the target event; a verification module 230, configured to verify the correctness of the target log according to the control time and the target event; and a determination module 240, configured to determine that the test for the TBOX log function passes if it is determined that the target log is correct.
[0044] In some embodiments, the number of the target events is multiple. Correspondingly, the control module 210 is configured to sequentially control the TBOX to trigger each target event and respectively record the control times for controlling the TBOX to trigger each target event; the acquisition module 220 is configured to, after all the target events are sequentially triggered, acquire the target logs generated by the TBOX according to each target event respectively; and the determination module 240 is configured to determine that the test for the TBOX log function passes if it is determined that all the target logs are correct.
[0045] In some embodiments, the target events include a network status event, a successful time synchronization event, a dialing event, and a device status event. The control module 210 is specifically configured to: control the connection between the programmable power supply and the first power supply terminal of the TBOX through a script, record the time when the programmable power supply is connected to the first power supply terminal of the TBOX, and power on the TBOX to trigger the network status event, the successful time synchronization event, the dialing event, and the device status event.
[0046] In some embodiments, the target events further include a signal gear status event. The control module 210 is further configured to: control the shielding box to close through a script and record the time when the shielding box is closed, so that the TBOX is in a weak network environment, and after waiting for a first duration, control the shielding box to open to enable the TBOX to trigger the signal gear status event, where the TBOX is located inside the shielding box.
[0047] In some embodiments, the target events further include a sleep event and a wake-up event. The control module 210 is further configured to: control the disconnection between the programmable power supply and the second power supply terminal of the TBOX through a script to make the TBOX enter the sleep state to trigger the sleep event; when it is detected that the working current of the TBOX is less than the current threshold, record the current time, and after waiting for a second duration, control the connection between the programmable power supply and the second power supply terminal of the TBOX to trigger the wake-up event.
[0048] In some embodiments, the target event further includes an emergency call event, a minimum data set sending event, and a short message receiving event. The control module 210 is further configured to: connect a relay to an emergency call button of the TBOX through a script, simulate that the emergency call button is pressed, and record the pressing moment, so that the TBOX triggers the emergency call event and the minimum data set sending event; after waiting for a third duration, disconnect a program-controlled power supply from a second power supply terminal of the TBOX through a script, so that the TBOX enters a sleep state, and simulate sending a remote control command from a mobile terminal to a service platform, so that the TBOX triggers the short message receiving event, wherein when the service platform receives the remote control command, it sends a short message to the TBOX to wake up the TBOX through the short message, and the TBOX enters a wake-up state when receiving the short message and triggers the short message receiving event.
[0049] In some embodiments, the verification module 230 is specifically configured to: determine an event field according to the target event; search for the event field in the target log, and if the event field exists in the target log and the time difference between the time information associated with the event field and the control moment is within a set range, determine that the target log is correct.
[0050] In some embodiments, the control module 210 is configured to control the TBOX to trigger a target event at a preset frequency and record the control moment until the number of times of controlling the TBOX to trigger the target event reaches a number threshold.
[0051] The test device for the TBOX log function provided by the embodiments of the present disclosure can execute the steps in the test method for the TBOX log function provided by the method embodiments of the present disclosure and can obtain the same beneficial effects, which will not be elaborated here.
[0052] Figure 3 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 3 shown, the electronic device 500 includes one or more processors 501 and a memory 502.
[0053] The processor 501 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 500 to perform desired functions.
[0054] The memory 502 may include one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory, etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage media, and the processor 501 may run the program instructions to implement the test method of the TBOX log function of any embodiment of the present application described above and / or other desired functions. Various contents such as initial extrinsic parameters, thresholds, etc. may also be stored in the computer-readable storage media.
[0055] In one example, the electronic device 500 may further include: an input device 503 and an output device 504, and these components are interconnected through a bus system and / or other forms of connection mechanisms (not shown). The input device 503 may include, for example, a keyboard, a mouse, etc. The output device 504 may output various information to the outside, including warning prompt information, braking force, etc. The output device 504 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0056] Of course, for simplicity, Figure 3 only some of the components related to the present application in the electronic device 500 are shown, and components such as buses, input / output interfaces, etc. are omitted. In addition, according to specific application scenarios, the electronic device 500 may further include any other appropriate components.
[0057] In addition to the above methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, and when the computer program instructions are run by a processor, the processor is caused to execute the steps of the test method of the TBOX log function provided by any embodiment of the present application.
[0058] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the embodiments of the present application. The programming languages include object-oriented programming languages, such as Java, C++, etc., and also include conventional procedural programming languages, such as the "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, executed as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0059] In addition, an embodiment of the present application may also be a computer-readable storage medium storing computer program instructions, which, when run by a processor, cause the processor to execute the steps of the test method for the TBOX log function provided by any embodiment of the present application.
[0060] The computer-readable storage medium may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may, for example, include but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0061] It should be noted that the terms used in the present application are only for describing specific embodiments and do not limit the scope of the present application. As shown in the specification and claims of the present application, unless the context clearly indicates an exception, words such as "a", "an", "one", and / or "the" do not specifically refer to the singular and may also include the plural. The term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, or device including a series of elements not only includes those elements but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, or device including the element.
[0062] It should also be noted that the orientation or positional relationship indicated by terms such as "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus cannot be understood as a limitation of the present application. Unless otherwise clearly specified and limited, terms such as "installed", "connected", "connected to" should be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection or an electrical connection; it may be directly connected or indirectly connected through an intermediate medium, and it may be the internal communication of two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood in specific situations.
[0063] In this article, specific examples are used to elaborate on the principles and implementation manners of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. The above is only the preferred implementation manner of the present application. It should be noted that due to the limited nature of literal expression and the objectively infinite specific structures, for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements, refinements or changes can be made, or the above technical features can be combined in an appropriate manner; these improvements, refinements, changes or combinations, or directly applying the concept and technical solution of the invention to other occasions without improvement, shall all be regarded as the protection scope of the present application.
Claims
1. A test method for the TBOX log function, characterized in that It includes: Control the TBOX to trigger the target event and record the control moment; Obtain the target log generated by the TBOX according to the target event; Verify the correctness of the target log according to the control moment and the target event; If it is determined that the target log is correct, it is determined that the test for the TBOX log function passes.
2. The method according to claim 1, characterized in that The target events include network status events, time calibration success events, dialing events, and device status events; The controlling the TBOX to trigger the target event and record the control moment includes: Control the programmable power supply to be connected to the first power supply terminal of the TBOX, and record the moment when the programmable power supply is connected to the first power supply terminal of the TBOX, so that the TBOX is powered on to trigger the network status event, time calibration success event, dialing event, and device status event.
3. The method according to claim 2, wherein The target event further includes a signal gear state event, and the controlling the TBOX to trigger the target event and record the control moment further includes: Control the shielding box to close, and record the moment when the shielding box is closed, so that the TBOX is in a weak network environment. After waiting for a first duration, control the shielding box to open, so that the TBOX triggers the signal gear state event. Wherein, the TBOX is located inside the shielding box, and the weak network environment refers to an environment where the communication metrics do not meet the preset requirements, and the communication metrics include one or more of bandwidth, signal strength, packet loss rate, and latency time.
4. The method according to claim 2, characterized in that, The target event further includes a sleep event and a wake-up event, and the controlling the TBOX to trigger the target event and record the control moment further includes: Control the programmable power supply to be disconnected from the second power supply terminal of the TBOX, so that the TBOX enters the sleep state to trigger the sleep event; When it is detected that the working current of the TBOX is less than the current threshold, record the current moment, and after waiting for a second duration, control the programmable power supply to be connected to the second power supply terminal of the TBOX to trigger the wake-up event.
5. The method according to claim 2, wherein The target event further includes an emergency call event, a minimum data set sending event, and a short message receiving event, and the controlling the TBOX to trigger the target event and record the control moment further includes: Control the relay to be connected to the emergency call button of the TBOX, simulate the pressing of the emergency call button, and record the pressing moment, so that the TBOX triggers the emergency call event and the minimum data set sending event; After waiting for a third duration, control the programmable power supply to be disconnected from the second power supply terminal of the TBOX, so that the TBOX enters the sleep state, and simulate sending a remote control command to the service platform through a mobile terminal, so that the TBOX triggers the short message receiving event. Wherein, when the service platform receives the remote control command, it sends a short message to the TBOX to wake up the TBOX through the short message. When the TBOX receives the short message, it enters the wake-up state and triggers the short message receiving event.
6. The method according to claim 1, characterized in that The verifying the correctness of the target log according to the control moment and the target event includes: Determine the event field according to the target event; Search for the event field in the target log. If the event field exists in the target log and the time difference between the time information associated with the event field and the control moment is within the set range, it is determined that the target log is correct.
7. The method according to claim 1, wherein The control TBOX triggers a target event and records the control time, including: Controlling the TBOX to trigger the target event at a preset frequency and recording the control time until the number of times the TBOX is controlled to trigger the target event reaches the number threshold.
8. A test device for the TBOX log function, characterized in that Including: A control module for controlling the TBOX to trigger the target event and recording the control time; An acquisition module for acquiring the target log generated by the TBOX according to the target event; A verification module for verifying the correctness of the target log according to the control time and the target event; If it is determined that the target log is correct, it is determined that the test for the TBOX log function passes.
9. An electronic device, characterized in that, The electronic device includes: A processor and a memory; The processor is configured to execute the steps of the test method for the TBOX log function according to any one of claims 1 to 7 by calling the program or instruction stored in the memory.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program or instruction, and the program or instruction causes the computer to execute the steps of the test method for the TBOX log function according to any one of claims 1 to 7.