Vehicle-mounted satellite communication chip and debugging method and system of protocol stack
By configuring the debugging mode and log management of the vehicle-mounted satellite communication chip through the host computer, the problems of signal stability and data transmission reliability of the vehicle-mounted satellite communication system were solved, and efficient log recording and fault diagnosis were achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2026-03-10
AI Technical Summary
Existing vehicle-mounted satellite communication systems face challenges in signal stability and data transmission reliability in complex environments. Debugging methods are inefficient and log recording mechanisms are not flexible enough, leading to increased analysis difficulty and high storage costs.
By sending working mode configuration messages through the host computer, the debugging mode, log type and level of the vehicle-mounted satellite communication chip and its protocol stack can be dynamically adjusted. Log information can be recorded and stored in real time or offline, and selective recording and structured storage are supported.
It improves the relevance and efficiency of log recording and analysis, reduces data clutter, supports rapid fault diagnosis, and enhances the system's ability to cope with different scenario requirements.
Smart Images

Figure CN120750744B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of satellite communication technology, and more specifically, to a debugging method and system for a vehicle-mounted satellite communication chip and protocol stack. Background Technology
[0002] Existing vehicle-mounted satellite communication systems operate in complex and ever-changing environments, facing challenges in signal stability and data transmission reliability. As the core component of data processing, the software protocol stack of vehicle-mounted satellite communication systems is subject to complex debugging processes. Traditional debugging methods are inefficient and cannot meet the needs of rapid iterative development, real-time performance optimization, and accurate fault location. In addition, existing logging mechanisms are not flexible enough to dynamically adjust according to different debugging needs, resulting in the recording of a large amount of irrelevant information, which increases the difficulty of analysis and storage costs. Although logging is crucial for monitoring system status and fault diagnosis, the current processes for collecting, storing, and analyzing logs are usually cumbersome and inefficient. This not only increases the workload of technical personnel but may also delay response time to emergencies.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This application provides a debugging method and system for vehicle-mounted satellite communication chips and protocol stacks, which at least solves the technical problem of chaotic log management when the host computer performs real-time or offline debugging of vehicle-mounted chips and their protocol stacks in vehicle-mounted satellite communication scenarios.
[0005] According to one aspect of the embodiments of this application, a debugging method for a vehicle-mounted satellite communication chip and a protocol stack is provided, comprising: receiving a working mode configuration message sent by a host computer, and configuring the protocol stack software according to the working mode configuration message, wherein the working mode configuration message includes at least: a debugging mode for the vehicle-mounted satellite communication chip and the corresponding protocol stack running the protocol stack software, a log type and a log level for the logs to be recorded; when the debugging mode is a real-time debugging mode, in response to a log output request message sent by the host computer, recording the running logs corresponding to the log type and log level, and sending the running logs to the host computer; when the debugging mode is an offline debugging mode, recording the running logs corresponding to the log type and log level, storing the running logs into different log files according to the log type, and in response to a log output request message sent by the host computer, sending the log file corresponding to the log output request message to the host computer.
[0006] Optionally, the protocol stack software is configured according to the working mode configuration message, including: parsing the working mode configuration message; configuring the working mode of the protocol stack software as real-time debugging mode or offline debugging mode; configuring the log collection method of the protocol stack software according to the log type and log level, wherein the log type includes at least one of the following: logs corresponding to each hardware module of the vehicle-mounted satellite communication chip, logs corresponding to each module in each layer of the protocol stack, and communication content logs; and the log level includes at least one of the following: error, warning, information, and debugging; and sending a working mode configuration response message to the host computer to reflect the configuration status of the protocol stack software.
[0007] Optionally, in response to a log output request message sent by the host computer, the system retrieves the operation log corresponding to the log type and log level, and sends the operation log to the host computer, including: receiving a real-time log output request message sent by the host computer; retrieving the operation log corresponding to the log type and log level, and sending the operation log to the host computer; receiving a termination output message sent by the host computer and stopping the retrieval of the operation log; and sending a termination output confirmation message to the host computer.
[0008] Optionally, the operation logs corresponding to the log type and log level are recorded and sent to the host computer, including: recording multiple first log information generated by each hardware module of the vehicle-mounted satellite communication chip matching the log level, and assembling each first log information, the physical address identifier of the hardware module that generated the first log information, and the log generation time into a structured log frame; and / or, recording multiple second log information generated by each module in each layer of the protocol stack matching the log level, and assembling each second log information, the layer identifier and module identifier of the module that generated the second log information, and the log generation time into a structured log frame; and / or, recording multiple communication content log information matching the log level, and assembling each communication content log information, the corresponding communication content identifier, and the log generation time into a structured log frame; and sending the obtained structured log frames to the host computer according to the generation sequence.
[0009] Optionally, the system records operation logs corresponding to log types and log levels, and stores the operation logs in different log files according to log types. This includes: recording multiple first log information generated by each hardware module of the vehicle-mounted satellite communication chip matching the log level; combining each first log information, the physical address identifier of the hardware module that generated the first log information, and the log generation time into a structured log frame; and writing the resulting multiple structured log frames into a first log file in the target storage medium; and / or, recording multiple second log information generated by each module in each layer of the protocol stack matching the log level; combining each second log information, the layer identifier and module identifier of the module that generated the second log information, and the log generation time into a structured log frame; and writing the resulting multiple structured log frames into a second log file in the target storage medium; and / or, recording multiple communication content log information matching the log level; combining each communication content log information, the corresponding communication content identifier, and the log generation time into a structured log frame; and writing the resulting multiple structured log frames into a third log file in the target storage medium.
[0010] Optionally, the method further includes: each time an offline debugging mode is entered, generating a new first log file and / or a second log file and / or a third log file corresponding to the current offline debugging mode in the target storage medium.
[0011] Optionally, the method further includes: when generating a new log file in the target storage medium, if the total capacity of the logs stored in the target storage medium exceeds a preset capacity threshold, using the newly generated log file to overwrite the log file that was first written to the target storage medium.
[0012] Optionally, in response to a log output request message sent by a host computer, sending the log file corresponding to the log output request message to the host computer includes: receiving a log file list request message sent by the host computer, wherein the log file list request message includes a range of log files; determining a log file list corresponding to the log file range, and sending a log file list response message carrying the log file list to the host computer; receiving a log file read request message sent by the host computer; determining a target log file corresponding to the log file read request message, and sending a log file read response message carrying the target log file to the host computer.
[0013] According to another aspect of the embodiments of this application, a debugging method for an on-board satellite communication chip and protocol stack is also provided, applied to a host computer, comprising: sending a working mode configuration message to the on-board satellite communication chip for configuring the working mode of the protocol stack software running on the on-board satellite communication chip, wherein the working mode configuration message includes at least: a debugging mode for the on-board satellite communication chip and the corresponding protocol stack, a log type and a log level for the log to be recorded; receiving a working mode configuration response message sent by the on-board satellite communication chip; sending a log output request message to the on-board satellite communication chip; and receiving log information corresponding to the log output request message sent by the on-board satellite communication chip.
[0014] Optionally, a log output request message is sent to the vehicle-mounted satellite communication chip, and log information corresponding to the log output request message is received from the vehicle-mounted satellite communication chip, including: sending a real-time log output request message to the vehicle-mounted satellite communication chip; receiving multiple structured log frames corresponding to log types and log levels sent by the vehicle-mounted satellite communication chip in a time sequence; sending a termination output message to the vehicle-mounted satellite communication chip; and receiving a termination output confirmation message sent by the vehicle-mounted satellite communication chip.
[0015] Optionally, sending a log output request message to the vehicle-mounted satellite communication chip and receiving log information corresponding to the log output request message sent by the vehicle-mounted satellite communication chip includes: sending a log file list request message to the vehicle-mounted satellite communication chip, wherein the log file list request message includes a range of log files; receiving a log file list response message sent by the vehicle-mounted satellite communication chip carrying a list of log files corresponding to the range of log files; determining the target log file to be read from the log file list and sending a log file read request message for reading the target log file to the vehicle-mounted satellite communication chip; and receiving a log file read response message sent by the vehicle-mounted satellite communication chip carrying the target log file.
[0016] Optionally, after receiving the log information corresponding to the log output request message sent by the vehicle-mounted satellite communication chip, the method further includes: parsing the received log information; and displaying log information of different log types in different windows.
[0017] According to another aspect of the embodiments of this application, a debugging system for a vehicle-mounted satellite communication chip and protocol stack is also provided, including: a host computer and a vehicle-mounted satellite communication chip. The vehicle-mounted satellite communication chip runs protocol stack software that controls the protocol stack. The host computer is used to send a working mode configuration message to the vehicle-mounted satellite communication chip to configure the working mode of the protocol stack software. The working mode configuration message includes at least: a debugging mode for the vehicle-mounted satellite communication chip and protocol stack, a log type and a log level to be recorded. The vehicle-mounted satellite communication chip is used to configure the protocol stack software according to the working mode configuration message and send a working mode configuration response message to the host computer. When the debugging mode is real-time debugging mode, in response to a log output request message sent by the host computer, the chip records the running log corresponding to the log type and log level and sends the running log to the host computer. When the debugging mode is offline debugging mode, the chip records the running log corresponding to the log type and log level and stores the running log into different log files according to the log type. In response to a log output request message sent by the host computer, the chip sends the log file corresponding to the log output request message to the host computer.
[0018] According to another aspect of the embodiments of this application, a computer program product is also provided, the computer program product comprising: a computer program, wherein the computer program, when executed by a processor, implements the above-described debugging method for the vehicle-mounted satellite communication chip and protocol stack.
[0019] According to another aspect of the embodiments of this application, an electronic device is also provided, the electronic device including: a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-described debugging method of the vehicle-mounted satellite communication chip and protocol stack through the computer program.
[0020] In this embodiment, the working mode (real-time debugging or offline debugging) of the vehicle-mounted satellite communication chip and its protocol stack software, as well as the log type and level to be recorded, are dynamically adjusted by sending working mode configuration messages from the host computer. This greatly enhances the system's ability to cope with different scenario requirements. Whether in real-time debugging or offline debugging mode, this method supports selective recording of specific types of logs and can save these logs in a structured form or transmit them to the host computer in real time. This approach not only improves the targeting of log recording but also facilitates subsequent analysis and fault diagnosis. In offline debugging mode, the running logs are stored in different files according to the log type. This method helps reduce unnecessary data mixing and improves data analysis efficiency, thereby solving the technical problem of chaotic log management when the host computer performs real-time or offline debugging of the vehicle-mounted chip and its protocol stack in the vehicle-mounted satellite communication scenario. Attached Figure Description
[0021] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0022] Figure 1 This is a schematic diagram of the structure of an optional vehicle-mounted satellite communication chip and protocol stack debugging system according to an embodiment of this application;
[0023] Figure 2 This is a flowchart illustrating an optional debugging method for a vehicle-mounted satellite communication chip and protocol stack according to an embodiment of this application.
[0024] Figure 3 This is a flowchart illustrating an optional debugging method for a vehicle-mounted satellite communication chip and protocol stack according to an embodiment of this application.
[0025] Figure 4 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of this application. Detailed Implementation
[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first," "second," etc., used in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0028] Example 1
[0029] According to an embodiment of this application, a debugging system for an on-board satellite communication chip and protocol stack is provided, such as... Figure 1As shown, the debugging system for the vehicle-mounted satellite communication chip and protocol stack includes at least: a host computer 11 and a vehicle-mounted satellite communication chip 12. The vehicle-mounted satellite communication chip 12 runs protocol stack software that controls the protocol stack.
[0030] The host computer 11 is used to send a working mode configuration message to the vehicle-mounted satellite communication chip to configure the working mode of the protocol stack software. The working mode configuration message includes at least the following: the debug mode for the vehicle-mounted satellite communication chip and the protocol stack, the log type and log level to be recorded.
[0031] The vehicle-mounted satellite communication chip 12 is used to configure the protocol stack software according to the working mode configuration message and send the working mode configuration response message to the host computer. When the debugging mode is real-time debugging mode, it responds to the log output request message sent by the host computer, records the running log corresponding to the log type and log level, and sends the running log to the host computer. When the debugging mode is offline debugging mode, it records the running log corresponding to the log type and log level, stores the running log in different log files according to the log type, and responds to the log output request message sent by the host computer, sends the log file corresponding to the log output request message to the host computer.
[0032] The following describes the implementation steps of the debugging system for the vehicle-mounted satellite communication chip and protocol stack, based on a specific implementation process.
[0033] The host computer sends a working mode configuration message to the vehicle-mounted satellite communication chip to configure the working mode of the protocol stack software running on the vehicle-mounted satellite communication chip. The working mode configuration message includes at least the following: the debug mode for the vehicle-mounted satellite communication chip and the corresponding protocol stack, the log type and log level to be logged;
[0034] The vehicle-mounted satellite communication chip receives the working mode configuration message sent by the host computer and configures the protocol stack software according to the working mode configuration message.
[0035] As an optional implementation, the vehicle-mounted satellite communication chip configures the protocol stack software according to the working mode configuration message. This process can be performed by the following steps: parsing the working mode configuration message; configuring the working mode of the protocol stack software as real-time debugging mode or offline debugging mode; configuring the log collection method of the protocol stack software according to the log type and log level, wherein the log type includes at least one of the following: logs corresponding to each hardware module of the vehicle-mounted satellite communication chip, logs corresponding to each module in each layer of the protocol stack, and communication content logs; and the log level includes at least one of the following: error, warning, information, and debugging; and sending a working mode configuration response message to the host computer to reflect the configuration status of the protocol stack software.
[0036] The host computer receives the working mode configuration response message sent by the vehicle-mounted satellite communication chip.
[0037] The host computer sends a log output request message to the vehicle-mounted satellite communication chip.
[0038] Specifically, the host computer sends a real-time log output request message to the vehicle-mounted satellite communication chip, or sends a log file list request message and a log file read request message to the vehicle-mounted satellite communication chip. The log file list request message includes the range of log files.
[0039] This can be understood as follows: When the debugging mode is real-time debugging mode, the host computer sends a real-time log output request message, and the vehicle-mounted satellite communication chip directly sends the operation log to the host computer. When the debugging mode is offline debugging mode, the host computer sends a log file list request message and a log file read request message. After the host computer receives the log file list response message from the vehicle-mounted satellite communication chip, it sends a log file read request message to read the target log file. Then, the vehicle-mounted satellite communication chip sends a log file read response message carrying the target log file.
[0040] When the debugging mode is real-time debugging mode, the vehicle-mounted satellite communication chip responds to the log output request message sent by the host computer, records the operation log corresponding to the log type and log level, and sends the operation log to the host computer. When the debugging mode is offline debugging mode, it records the operation log corresponding to the log type and log level, stores the operation log into different log files according to the log type, and responds to the log output request message sent by the host computer, sends the log file corresponding to the log output request message to the host computer.
[0041] The interaction process between the host computer and the vehicle-mounted satellite communication chip under different debugging modes can be carried out in the following steps:
[0042] Specifically, when the debugging mode is real-time debugging mode:
[0043] As an optional implementation, when the debugging mode is real-time debugging mode, the vehicle-mounted satellite communication chip responds to the log output request message sent by the host computer, obtains the operation log corresponding to the log type and log level, and sends the operation log to the host computer. This can be done through the following steps: receiving the real-time log output request message sent by the host computer; obtaining the operation log corresponding to the log type and log level and sending the operation log to the host computer; receiving the termination output message sent by the host computer and stopping the acquisition of operation logs; and sending a termination output confirmation message to the host computer.
[0044] As an optional implementation, when the debugging mode is real-time debugging mode, the vehicle-mounted satellite communication chip acquires the operation logs corresponding to the log type and log level, and sends the operation logs to the host computer. This can be done through the following steps: acquiring multiple first log information generated by each hardware module of the vehicle-mounted satellite communication chip that matches the log level, and assembling each first log information, the physical address identifier of the hardware module that generated the first log information, and the log generation time into a structured log frame; and / or, recording multiple second log information generated by each module in each layer of the protocol stack that matches the log level, and assembling each second log information, the layer identifier and module identifier of the module that generated the second log information, and the log generation time into a structured log frame; and / or, recording multiple communication content log information that matches the log level, and assembling each communication content log information, the corresponding communication content identifier, and the log generation time into a structured log frame; and sending the obtained structured log frames to the host computer according to the generation sequence.
[0045] The above interaction process can be understood as follows: the host computer sends a real-time log output request message, the vehicle-mounted satellite communication chip receives the real-time log output request message sent by the host computer, the vehicle-mounted satellite communication chip obtains the operation log corresponding to the log type and log level, and sends a structured log frame to the host computer, the host computer receives the structured log frame, the host computer sends a termination output message to the vehicle-mounted satellite communication chip, the vehicle-mounted satellite communication chip sends a termination output confirmation message, and the host computer receives the termination output confirmation message sent by the vehicle-mounted satellite communication chip.
[0046] As an optional implementation, after the host computer receives the log information corresponding to the log output request message sent by the vehicle-mounted satellite communication chip, the method further includes: parsing the received log information; and displaying log information of different log types in different windows.
[0047] Specifically, when the debugging mode is offline debugging mode:
[0048] As an optional implementation, when the debugging mode is offline debugging mode, the vehicle-mounted satellite communication chip records operation logs corresponding to log types and log levels, and stores the operation logs into different log files according to log types, including: recording multiple first log information generated by each hardware module of the vehicle-mounted satellite communication chip that matches the log level, combining each first log information, the physical address identifier of the hardware module that generated the first log information, and the log generation time into a structured log frame, and writing the resulting multiple structured log frames into a first log file in the target storage medium; and / or, recording multiple second log information generated by each module in each layer of the protocol stack that matches the log level, combining each second log information, the layer identifier and module identifier of the module that generated the second log information, and the log generation time into a structured log frame, and writing the resulting multiple structured log frames into a second log file in the target storage medium; and / or, recording multiple communication content log information that matches the log level, combining each communication content log information, the corresponding communication content identifier, and the log generation time into a structured log frame, and writing the resulting multiple structured log frames into a third log file in the target storage medium.
[0049] As an optional implementation, when the debugging mode is offline debugging mode, each time the offline debugging mode is entered, a new first log file and / or second log file and / or third log file corresponding to the current offline debugging mode are generated in the target storage medium.
[0050] As an optional implementation, when generating a new log file in the target storage medium, if the total capacity of the logs stored in the target storage medium exceeds a preset capacity threshold, the newly generated log file overwrites the log file that was first written to the target storage medium.
[0051] As an optional implementation, when the debugging mode is offline debugging mode, after obtaining multiple log files, in response to a log output request message sent by the host computer, the log file corresponding to the log output request message is sent to the host computer, including: receiving a log file list request message sent by the host computer, wherein the log file list request message includes a range of log files; determining a log file list corresponding to the log file range, and sending a log file list response message carrying the log file list to the host computer; receiving a log file read request message sent by the host computer; determining the target log file corresponding to the log file read request message, and sending a log file read response message carrying the target log file to the host computer.
[0052] The above interaction process can be understood as follows: the host computer sends a log file list request message to the vehicle-mounted satellite communication chip, wherein the log file list request message includes a range of log files; the vehicle-mounted satellite communication chip sends a log file list response message to the host computer carrying a log file list corresponding to the log file range; the host computer sends a log file read request message to the vehicle-mounted satellite communication chip for reading the target log file; and the vehicle-mounted satellite communication chip sends a log file read response message to the host computer carrying the target log file.
[0053] As an optional implementation, after the host computer receives the log information corresponding to the log output request message sent by the vehicle-mounted satellite communication chip, the method further includes: parsing the received log information; and displaying log information of different log types in different windows.
[0054] In this embodiment, the working mode (real-time debugging or offline debugging) of the vehicle-mounted satellite communication chip and its protocol stack software, as well as the log type and level to be recorded, are dynamically adjusted by sending working mode configuration messages from the host computer. This greatly enhances the system's ability to cope with different scenario requirements. Whether in real-time debugging or offline debugging mode, this method supports selective recording of specific types of logs and can save these logs in a structured form or transmit them to the host computer in real time. This approach not only improves the targeting of log recording but also facilitates subsequent analysis and fault diagnosis. In offline debugging mode, the running logs are stored in different files according to the log type. This method helps reduce unnecessary data mixing and improves data analysis efficiency, thereby solving the technical problem of chaotic log management when the host computer performs real-time or offline debugging of the vehicle-mounted chip and its protocol stack in the vehicle-mounted satellite communication scenario.
[0055] Example 2
[0056] According to an embodiment of this application, a debugging method for the vehicle-mounted satellite communication chip and protocol stack in the debugging system of the vehicle-mounted satellite communication chip and protocol stack in Embodiment 1 is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0057] Figure 2 This is a flowchart illustrating a debugging method for a vehicle-mounted satellite communication chip and protocol stack according to an embodiment of this application. Figure 2 As shown, the method includes the following steps:
[0058] Step S202: Receive the working mode configuration message sent by the host computer, and configure the protocol stack software according to the working mode configuration message. The working mode configuration message includes at least: the debugging mode of the vehicle-mounted satellite communication chip and the corresponding protocol stack for running the protocol stack software, the log type and log level of the log to be recorded.
[0059] Step S204: When the debugging mode is real-time debugging mode, in response to the log output request message sent by the host computer, record the running log corresponding to the log type and log level, and send the running log to the host computer.
[0060] Step S206: When the debugging mode is offline debugging mode, record the running logs corresponding to the log type and log level, and store the running logs into different log files according to the log type. In response to the log output request message sent by the host computer, send the log file corresponding to the log output request message to the host computer.
[0061] The following describes the steps of debugging the vehicle-mounted satellite communication chip and protocol stack, based on a specific implementation process.
[0062] The system receives the working mode configuration message sent by the host computer and configures the protocol stack software according to the working mode configuration message. The working mode configuration message includes at least the following: the debug mode of the vehicle-mounted satellite communication chip and the corresponding protocol stack for running the protocol stack software, the log type and log level of the logs to be recorded.
[0063] As an optional implementation, configuring the protocol stack software based on the working mode configuration message can be achieved through the following steps: parsing the working mode configuration message; configuring the working mode of the protocol stack software as real-time debugging mode or offline debugging mode; configuring the log collection method of the protocol stack software according to the log type and log level, wherein the log type includes at least one of the following: logs corresponding to each hardware module of the vehicle-mounted satellite communication chip, logs corresponding to each module in each layer of the protocol stack, and communication content logs; and the log level includes at least one of the following: error, warning, information, and debugging; and sending a working mode configuration response message to the host computer to reflect the configuration status of the protocol stack software.
[0064] When the debugging mode is real-time debugging mode, in response to the log output request message sent by the host computer, the running log corresponding to the log type and log level is recorded, and the running log is sent to the host computer.
[0065] As an optional implementation, in response to a log output request message sent by the host computer, the operation log corresponding to the log type and log level is obtained, and the operation log is sent to the host computer. This can be done through the following steps: receiving a real-time log output request message sent by the host computer; obtaining the operation log corresponding to the log type and log level and sending the operation log to the host computer; receiving a termination output message sent by the host computer and stopping the acquisition of operation logs; and sending a termination output confirmation message to the host computer.
[0066] As an optional implementation, recording operation logs corresponding to log types and log levels, and sending the operation logs to the host computer, can be done through the following steps: recording multiple first log information generated by each hardware module of the vehicle-mounted satellite communication chip matching the log level, and combining each first log information, the physical address identifier of the hardware module that generated the first log information, and the log generation time into a structured log frame; and / or, recording multiple second log information generated by each module in each layer of the protocol stack matching the log level, and combining the layer identifier and module identifier of the module that generated the second log information under each second log information, and the log generation time into a structured log frame; and / or, recording multiple communication content log information matching the log level, and combining each communication content log information, the corresponding communication content identifier, and the log generation time into a structured log frame; and sending the obtained structured log frames to the host computer according to the generation sequence.
[0067] When the debugging mode is offline debugging mode, the system records the running logs corresponding to the log type and log level, and stores the running logs into different log files according to the log type. In response to the log output request message sent by the host computer, the system sends the log file corresponding to the log output request message to the host computer.
[0068] As an optional implementation, recording operation logs corresponding to log types and log levels, and storing the operation logs into different log files according to log types, can be done through the following steps: recording multiple first log information generated by each hardware module of the vehicle-mounted satellite communication chip matching the log level; combining each first log information, the physical address identifier of the hardware module that generated the first log information, and the log generation time into a structured log frame; and writing the resulting multiple structured log frames into a first log file in the target storage medium; and / or, recording multiple second log information generated by each module in each layer of the protocol stack matching the log level; combining each second log information, the layer identifier and module identifier of the module that generated the second log information, and the log generation time into a structured log frame; and writing the resulting multiple structured log frames into a second log file in the target storage medium; and / or, recording multiple communication content log information matching the log level; combining each communication content log information, the corresponding communication content identifier, and the log generation time into a structured log frame; and writing the resulting multiple structured log frames into a third log file in the target storage medium.
[0069] As an optional implementation, each time an offline debugging mode is entered, a new first log file and / or second log file and / or third log file corresponding to the current offline debugging mode are generated in the target storage medium.
[0070] As an optional implementation, when generating a new log file in the target storage medium, if the total capacity of the logs stored in the target storage medium exceeds a preset capacity threshold, the newly generated log file overwrites the log file that was first written to the target storage medium.
[0071] As an optional implementation, in response to a log output request message sent by the host computer, sending the log file corresponding to the log output request message to the host computer can be performed through the following steps: receiving a log file list request message sent by the host computer, wherein the log file list request message includes a range of log files; determining a log file list corresponding to the log file range, and sending a log file list response message carrying the log file list to the host computer; receiving a log file read request message sent by the host computer; determining the target log file corresponding to the log file read request message, and sending a log file read response message carrying the target log file to the host computer.
[0072] It should be noted that each implementation step in the debugging method of the vehicle-mounted satellite communication chip and protocol stack in this application corresponds one-to-one with each implementation step of the debugging system of the vehicle-mounted satellite communication chip and protocol stack in Example 1. Since Example 1 has been described in detail, some details not shown in this embodiment can be referred to Example 1, and will not be elaborated further here.
[0073] Example 3
[0074] According to an embodiment of this application, a debugging method for the vehicle-mounted satellite communication chip and protocol stack of the host computer in the debugging system of the vehicle-mounted satellite communication chip and protocol stack in Embodiment 1 is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than that shown here.
[0075] Figure 3 This is a flowchart illustrating a debugging method for a vehicle-mounted satellite communication chip and protocol stack according to an embodiment of this application. Figure 3 As shown, the method includes the following steps:
[0076] Step S302: Send a working mode configuration message to the vehicle-mounted satellite communication chip to configure the working mode of the protocol stack software running on the vehicle-mounted satellite communication chip. The working mode configuration message includes at least: the debug mode for the vehicle-mounted satellite communication chip and the corresponding protocol stack, the log type and log level to be recorded.
[0077] Step S304: Receive the working mode configuration response message sent by the vehicle-mounted satellite communication chip;
[0078] Step S306: Send a log output request message to the vehicle-mounted satellite communication chip;
[0079] Step S308: Receive log information corresponding to the log output request message sent by the vehicle-mounted satellite communication chip.
[0080] The following describes the steps of debugging the vehicle-mounted satellite communication chip and protocol stack, based on a specific implementation process.
[0081] Send a working mode configuration message to the vehicle-mounted satellite communication chip to configure the working mode of the protocol stack software running the vehicle-mounted satellite communication chip. The working mode configuration message includes at least: the debug mode for the vehicle-mounted satellite communication chip and the corresponding protocol stack, the log type and log level to be logged.
[0082] The vehicle-mounted satellite communication chip receives the working mode configuration message sent by the host computer, configures the protocol stack software according to the working mode configuration message, and sends the working mode configuration response message to the host computer after completing the configuration.
[0083] Receive the working mode configuration response message sent by the vehicle-mounted satellite communication chip.
[0084] Send log output request messages to the vehicle-mounted satellite communication chip in different debugging modes.
[0085] As an optional implementation, in real-time debugging mode, a real-time log output request message is sent to the vehicle-mounted satellite communication chip; multiple structured log frames corresponding to log types and log levels are received from the vehicle-mounted satellite communication chip in a time sequence; a termination output message is sent to the vehicle-mounted satellite communication chip; and a termination output confirmation message is received from the vehicle-mounted satellite communication chip.
[0086] As an optional implementation, the structured log frame generation process is as follows: the vehicle-mounted satellite communication chip records multiple first log information generated by each hardware module of the vehicle-mounted satellite communication chip that matches the log level, and combines each first log information, the physical address identifier of the hardware module that generated the first log information, and the log generation time into a structured log frame; and / or, records multiple second log information generated by each module in each layer of the protocol stack that matches the log level, and combines the layer identifier and module identifier of the module that generated the second log information under each second log information, and the log generation time into a structured log frame; and / or, records multiple communication content log information that matches the log level, and combines each communication content log information, the corresponding communication content identifier, and the log generation time into a structured log frame; and sends the obtained structured log frames to the host computer according to the generation sequence.
[0087] As an optional implementation, in offline debugging mode, a log file list request message is sent to the vehicle-mounted satellite communication chip, wherein the log file list request message includes a range of log files; a log file list response message carrying a log file list corresponding to the log file range is received from the vehicle-mounted satellite communication chip; the target log file to be read is determined from the log file list, and a log file read request message for reading the target log file is sent to the vehicle-mounted satellite communication chip; and a log file read response message carrying the target log file is received from the vehicle-mounted satellite communication chip.
[0088] As an optional implementation, the log file generation process is as follows: the vehicle-mounted satellite communication chip records multiple first log information generated by each hardware module of the vehicle-mounted satellite communication chip that matches the log level; each first log information, the physical address identifier of the hardware module that generated the first log information, and the log generation time are combined into a structured log frame; the resulting multiple structured log frames are written into a first log file in the target storage medium; and / or, records multiple second log information generated by each module in each layer of the protocol stack that matches the log level; each second log information, the layer identifier and module identifier of the module that generated the second log information, and the log generation time are combined into a structured log frame; the resulting multiple structured log frames are written into a second log file in the target storage medium; and / or, records multiple communication content log information that matches the log level; each communication content log information, the corresponding communication content identifier, and the log generation time are combined into a structured log frame; the resulting multiple structured log frames are written into a third log file in the target storage medium.
[0089] Parse the received log messages; display log messages of different types in different windows.
[0090] It should be noted that each implementation step in the debugging method of the vehicle-mounted satellite communication chip and protocol stack in this application corresponds one-to-one with each implementation step of the debugging system of the vehicle-mounted satellite communication chip and protocol stack in Example 1. Since Example 1 has been described in detail, some details not shown in this embodiment can be referred to Example 1, and will not be elaborated further here.
[0091] Example 4
[0092] According to an embodiment of this application, a computer program product is also provided, which includes a computer program, wherein when the computer program is executed by a processor, it implements the debugging method of the vehicle-mounted satellite communication chip and protocol stack in embodiment 2 or embodiment 3.
[0093] According to an embodiment of this application, a non-volatile storage medium is also provided, which includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the debugging method of the vehicle-mounted satellite communication chip and protocol stack in Embodiment 2 or Embodiment 3 by running the computer program.
[0094] According to an embodiment of this application, a processor is also provided for running a computer program, wherein the computer program executes the debugging method of the vehicle-mounted satellite communication chip and protocol stack in embodiment 2 or embodiment 3.
[0095] According to an embodiment of this application, an electronic device is also provided, comprising: a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the debugging method of the vehicle-mounted satellite communication chip and protocol stack in Embodiment 2 or Embodiment 3 through the computer program.
[0096] Specifically, the computer program can execute the following steps during runtime: receiving a working mode configuration message sent by a host computer, and configuring the protocol stack software according to the working mode configuration message. The working mode configuration message includes at least: the debug mode for the vehicle-mounted satellite communication chip running the protocol stack software and the corresponding protocol stack, the log type and log level to be recorded; when the debug mode is real-time debug mode, responding to a log output request message sent by the host computer, recording the running logs corresponding to the log type and log level, and sending the running logs to the host computer; when the debug mode is offline debug mode, recording the running logs corresponding to the log type and log level, storing the running logs in different log files according to the log type, and responding to a log output request message sent by the host computer, sending the log file corresponding to the log output request message to the host computer.
[0097] Specifically, when the computer program runs, it can execute the following steps: sending a working mode configuration message to the vehicle-mounted satellite communication chip to configure the working mode of the protocol stack software running on the vehicle-mounted satellite communication chip, wherein the working mode configuration message includes at least: the debug mode for the vehicle-mounted satellite communication chip and the corresponding protocol stack, the log type and log level to be logged; receiving a working mode configuration response message sent by the vehicle-mounted satellite communication chip; sending a log output request message to the vehicle-mounted satellite communication chip; and receiving log information corresponding to the log output request message sent by the vehicle-mounted satellite communication chip.
[0098] As an alternative implementation, the above-mentioned electronic device may exist in the form of a mobile terminal, a computer terminal, or a similar computing device. Figure 4 A hardware block diagram of an electronic device for implementing a debugging method for a vehicle-mounted satellite communication chip and protocol stack is shown. Figure 4 As shown, the electronic device 40 may include one or more processors 402 (shown as 402a, 402b, ..., 402n in the figure) 402 (processor 402 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 404 for storing data, and a transmission device 406 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 4 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, electronic device 40 may also include... Figure 4 The more or fewer components shown, or having the same Figure 4 The different configurations shown.
[0099] It should be noted that the aforementioned one or more processors 402 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element of the electronic device 40. As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0100] The memory 404 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the debugging method of the vehicle-mounted satellite communication chip and protocol stack in this embodiment of the application. The processor 402 executes various functional applications and data processing by running the software programs and modules stored in the memory 404, thereby implementing the above-mentioned application vulnerability detection method. The memory 404 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 404 may further include memory remotely located relative to the processor 402, and these remote memories can be connected to the electronic device 40 via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0101] The transmission device 406 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the electronic device 40. In one example, the transmission device 406 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 406 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0102] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows the user to interact with the user interface of the electronic device 40.
[0103] The sequence numbers of the above embodiments are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0104] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0105] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.
[0106] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0107] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0108] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0109] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for debugging a vehicle-mounted satellite communication chip and protocol stack, applied to a vehicle-mounted satellite communication chip, and characterized in that, The method comprises the following steps: receiving a working mode configuration message sent by a host computer, and configuring protocol stack software according to the working mode configuration message, wherein the working mode configuration message at least comprises a debugging mode of a vehicle-mounted satellite communication chip and a corresponding protocol stack for running the protocol stack software, a log type to be recorded, and a log level; in a case where the debugging mode is a real-time debugging mode, in response to a log output request message sent by the host computer, recording running logs corresponding to the log type and the log level, and sending the running logs to the host computer; in a case where the debugging mode is an offline debugging mode, recording running logs corresponding to the log type and the log level, storing the running logs as different log files according to the log type, and in response to a log output request message sent by the host computer, sending a log file corresponding to the log output request message to the host computer.
2. The method of claim 1, wherein, The method of configuring the protocol stack software according to the working mode configuration message comprises the following steps: parsing the working mode configuration message; configuring the working mode of the protocol stack software as a real-time debugging mode or an offline debugging mode; configuring a log collection mode of the protocol stack software according to the log type and the log level, wherein the log type comprises at least one of the following: logs corresponding to each hardware module of the vehicle-mounted satellite communication chip, logs corresponding to each module in each level of the protocol stack, and communication content logs, and the log level comprises at least one of the following: error, warning, information, and debugging; sending a working mode configuration response message reflecting a configuration state of the protocol stack software to the host computer.
3. The method of claim 2, wherein, In response to the log output request message sent by the host computer, the method of obtaining running logs corresponding to the log type and the log level and sending the running logs to the host computer comprises the following steps: receiving a real-time log output request message sent by the host computer; obtaining running logs corresponding to the log type and the log level, and sending the running logs to the host computer; receiving a termination output message sent by the host computer, and stopping obtaining running logs; sending a termination output confirmation message to the host computer.
4. The method of claim 3, wherein, The method of recording running logs corresponding to the log type and the log level and sending the running logs to the host computer comprises the following steps: recording a plurality of first log information generated by each hardware module of the vehicle-mounted satellite communication chip matching the log level, and composing each first log information, physical address identification information of a hardware module generating the first log information, and log generation time into a structured log frame; and / or recording a plurality of second log information generated by each module in each level of the protocol stack matching the log level, and composing each second log information, level identification information and module identification information of a module generating the second log information, and log generation time into a structured log frame; and / or record a plurality of communication content log information matching the log level, and form a structured log frame for each of the communication content log information, corresponding communication content identifier, and log generation time; send each of the obtained structured log frames to the upper computer according to the generation time sequence.
5. The method of claim 2, wherein, record a running log corresponding to the log type and the log level, and store the running log as different log files according to the log type, including: record a plurality of first log information generated by each hardware module of the vehicle-mounted satellite communication chip matching the log level, form a structured log frame for each of the first log information, physical address identifier information of the hardware module generating the first log information, and log generation time, and write the obtained plurality of structured log frames into a first log file in the target storage medium; and / or, record a plurality of second log information generated by each module in each level of the protocol stack matching the log level, form a structured log frame for each of the second log information, level identifier information and module identifier information of the module generating the second log information, and log generation time, and write the obtained plurality of structured log frames into a second log file in the target storage medium; and / or, record a plurality of communication content log information matching the log level, and form a structured log frame for each of the communication content log information, corresponding communication content identifier, and log generation time, and write the obtained plurality of structured log frames into a third log file in the target storage medium.
6. The method of claim 5, wherein, The method further includes: generate a new first log file and / or a new second log file and / or a new third log file corresponding to the current offline debugging mode in the target storage medium each time the offline debugging mode is entered.
7. The method of claim 6, wherein, The method further includes: when a new log file is generated in the target storage medium, if the total capacity of the logs stored in the target storage medium exceeds a preset capacity threshold, use the newly generated log file to overwrite the log file first written into the target storage medium.
8. The method of claim 6, wherein, in response to a log output request message sent by the upper computer, send a log file corresponding to the log output request message to the upper computer, including: receive a log file list request message sent by the upper computer, wherein the log file list request message includes a log file range; determine a log file list corresponding to the log file range, and send a log file list response message carrying the log file list to the upper computer; receive a log file reading request message sent by the upper computer; determine a target log file corresponding to the log file reading request message, and send a log file reading response message carrying the target log file to the upper computer. 9.A method for debugging a vehicle satellite communication chip and protocol stack, applied to an upper computer, and characterized in that, including: send a work mode configuration message for configuring the work mode of the protocol stack software running on the vehicle-mounted satellite communication chip to the vehicle-mounted satellite communication chip, wherein the work mode configuration message at least includes: a debugging mode for the vehicle-mounted satellite communication chip and the corresponding protocol stack, a log type and a log level of the log to be recorded. Receiving a working mode configuration response message sent by the vehicle-mounted satellite communication chip; Sending a log output request message to the vehicle-mounted satellite communication chip; Receiving log information corresponding to the log output request message sent by the vehicle-mounted satellite communication chip.
10. The method of claim 9, wherein, Sending a log output request message to the vehicle-mounted satellite communication chip, and receiving log information corresponding to the log output request message sent by the vehicle-mounted satellite communication chip, comprises: Sending a real-time log output request message to the vehicle-mounted satellite communication chip; Receiving a plurality of structured log frames corresponding to the log type and the log level sent by the vehicle-mounted satellite communication chip in sequence; Sending a termination output message to the vehicle-mounted satellite communication chip; Receiving a termination output confirmation message sent by the vehicle-mounted satellite communication chip.
11. The method of claim 9, wherein, Sending a log output request message to the vehicle-mounted satellite communication chip, and receiving log information corresponding to the log output request message sent by the vehicle-mounted satellite communication chip, comprises: Sending a log file list request message to the vehicle-mounted satellite communication chip, wherein the log file list request message includes a log file range; Receiving a log file list response message carrying a log file list corresponding to the log file range sent by the vehicle-mounted satellite communication chip; Determining a target log file to be read from the log file list, and sending a log file reading request message for reading the target log file to the vehicle-mounted satellite communication chip; Receiving a log file reading response message carrying the target log file sent by the vehicle-mounted satellite communication chip.
12. The method of claim 9, wherein, After receiving the log information corresponding to the log output request message sent by the vehicle-mounted satellite communication chip, the method further comprises: Parsing each received log information; Displaying log information of different log types in different windows.
13. A debugging system for a vehicle-mounted satellite communication chip and protocol stack, characterized in that, Comprise: The host computer and the vehicle-mounted satellite communication chip, the protocol stack software of the control protocol stack is run on the vehicle-mounted satellite communication chip, wherein, The host computer is configured to send a working mode configuration message to the vehicle-mounted satellite communication chip for configuring the working mode of the protocol stack software, wherein the working mode configuration message at least includes: a debugging mode for the vehicle-mounted satellite communication chip and the protocol stack, a log type and a log level of logs to be recorded; The vehicle-mounted satellite communication chip is configured to configure the protocol stack software according to the working mode configuration message, and send a working mode configuration response message to the host computer; in the case that the debugging mode is a real-time debugging mode, in response to the log output request message sent by the host computer, record the running log corresponding to the log type and the log level, and send the running log to the host computer; in the case that the debugging mode is an offline debugging mode, record the running log corresponding to the log type and the log level, and store the running log as different log files according to the log type, and in response to the log output request message sent by the host computer, send the log file corresponding to the log output request message to the host computer.
14. A computer program product, characterised in that, Comprise: A computer program, wherein the computer program, when executed by a processor, implements the debugging method of the vehicle-mounted satellite communication chip and protocol stack according to any one of claims 1 to 12.
15. An electronic device, comprising: comprising: a memory and a processor, wherein the memory has stored therein a computer program, and the processor is configured to execute the debugging method of the vehicle-mounted satellite communication chip and protocol stack according to any one of claims 1 to 12 by means of the computer program.
Citation Information
Patent Citations
Log capturing method and device, equipment and storage medium
CN115209394A
Log file output control method and device and protocol stack analysis equipment
CN116483725A