Log sending method and device, computer device and storage medium
By detecting the near-field communication commands of the target terminal, obtaining the Bluetooth network configuration status, and releasing the Bluetooth hotspot, the problem of low log transmission efficiency of smart devices under abnormal conditions is solved, and efficient log sending without power interruption is achieved.
Patent Information
- Application Number
- CN202411868002.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2044-12-18
AI Technical Summary
Existing smart devices are inefficient at obtaining log information via USB interface when encountering abnormal situations, and are also inefficient at transmitting large amounts of log data via NFC, making it impossible to efficiently transmit logs remotely.
By detecting the near-field communication commands of the target terminal, the Bluetooth network configuration status of the device is obtained, and the Bluetooth hotspot is released according to the status. The Bluetooth hotspot is used to transmit logs, avoiding power outages of the device, and supporting log transmission under any network configuration status.
It enables efficient and direct sending of device logs without the need for a wired interface, improving the efficiency and success rate of log transmission and solving the problem of remote log transmission between devices and terminals.
Smart Images

Figure CN119729432B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of communication, and particularly relate to a log sending method and device, a computer device and a storage medium. BACKGROUND
[0002] The existing intelligent device (for example, a central control system) needs to have dustproof and waterproof capabilities due to the influence of weather dampness and other factors, so the USB interface of the device is designed to be hidden in the board. When an abnormal situation occurs, the USB interface cannot be directly connected to obtain log information, and the device needs to be powered off for processing until the abnormality is restored to normal, and then the USB connection can be used to obtain the log. The efficiency of obtaining the log is very low.
[0003] After the device is configured with Bluetooth, it will switch to a Mesh protocol (a Bluetooth private protocol) for controlling Bluetooth Mesh devices. In this case, a terminal such as a mobile phone cannot directly obtain the log. Although NFC technology can transmit data within a short distance, it is only suitable for small amounts of data due to its slow transmission rate. Therefore, when a large amount of log data needs to be transmitted, using NFC transmission will result in low efficiency. Therefore, how to improve the efficiency of sending logs to the terminal has become a problem to be solved. SUMMARY
[0004] In view of this, to solve the above technical problem of improving the efficiency of log sending, embodiments of the present application provide a log sending method and device, a computer device and a storage medium.
[0005] In a first aspect, the embodiments of the present application provide a log sending method, comprising:
[0006] When a target device detects a target instruction sent by a target terminal through near field communication, obtaining the current Bluetooth configuration network state of the target device;
[0007] According to the Bluetooth configuration network state, controlling the target device to release a Bluetooth hotspot;
[0008] When it is detected that the target terminal connects the Bluetooth hotspot, according to the target instruction, sending a target log of the target device to the target terminal.
[0009] In one possible implementation, when the target device detects the target instruction sent by the target terminal through near field communication, the target device obtains the current Bluetooth configuration network state, comprising:
[0010] When a near field communication signal of the target terminal is detected, obtaining a target instruction contained in the near field communication signal;
[0011] Determining whether the target instruction is used to obtain a target log of the target device;
[0012] If so, the current Bluetooth network configuration status of the target device is obtained according to the target instruction. The Bluetooth network configuration status includes: timeout without network configuration, waiting for network configuration, and network configuration.
[0013] In one possible implementation, controlling the target device to release the Bluetooth hotspot based on the Bluetooth network configuration status includes:
[0014] When the Bluetooth pairing status is in the timeout and not paired status, control the Bluetooth hotspot of the target device to turn off;
[0015] Receive the new hotspot name sent by the target terminal;
[0016] After modifying the historical hotspot name of the Bluetooth hotspot according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
[0017] In one possible implementation, controlling the target device to release the Bluetooth hotspot based on the Bluetooth network configuration status includes:
[0018] When the Bluetooth pairing status is "paired", control the target device to disconnect from the currently connected mesh network;
[0019] After reinitializing the target device's current mesh network protocol to Bluetooth, the Bluetooth hotspot is released.
[0020] In one possible implementation, controlling the target device to release the Bluetooth hotspot based on the Bluetooth network configuration status includes:
[0021] When the Bluetooth network configuration status is in the waiting network configuration status, the current hotspot name of the Bluetooth hotspot is sent to the target terminal;
[0022] Determine whether the target terminal is connected to the Bluetooth hotspot within a preset time period;
[0023] If not, then receive the new hotspot name sent by the target terminal;
[0024] After modifying the historical hotspot name of the Bluetooth hotspot according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
[0025] In one possible implementation, the method further includes:
[0026] When the target instruction is used to send the target log to the server, it is determined whether the target device is connected to the server;
[0027] If so, the target log will be sent to the server;
[0028] Alternatively, when the target terminal fails to connect to the Bluetooth hotspot, the target log is sent to the server.
[0029] In one possible implementation, sending the target device's target log to the target terminal according to the target instruction includes:
[0030] The target terminal obtains its historical processing methods for the acquired logs, including: local viewing and / or uploading to a server;
[0031] The first log is determined from the target log according to the historical processing method, and the first log is sent to the server;
[0032] And / or, determine a second log from the target log according to the historical processing method, and send the second log to the target terminal.
[0033] In a second aspect, embodiments of the present invention provide a log sending device, comprising:
[0034] The acquisition module is used to acquire the current Bluetooth network configuration status of the target device when the target device detects a target command sent by the target terminal through near-field communication.
[0035] The control module is used to control the target device to release the Bluetooth hotspot according to the Bluetooth network configuration status;
[0036] The sending module is used to send the target device's target log to the target terminal according to the target instruction when the target terminal is detected to be connected to the Bluetooth hotspot.
[0037] Thirdly, embodiments of the present invention provide a computer device, including: a processor and a memory, wherein the processor is configured to execute a log sending program stored in the memory to implement the log sending method described in any one of the first aspects above.
[0038] Fourthly, embodiments of the present invention provide a storage medium storing one or more programs, which can be executed by one or more processors to implement the log sending method described in any one of the first aspects above.
[0039] The log sending scheme provided in this invention obtains the current Bluetooth network configuration status of the target device when it detects a target command sent by a target terminal via near-field communication; controls the target device to release its Bluetooth hotspot based on the Bluetooth network configuration status; and sends the target log of the target device to the target terminal according to the target command when the target terminal is detected to be connected to the Bluetooth hotspot. Therefore, the release of the Bluetooth hotspot can be controlled based on the Bluetooth network configuration status when a target terminal is detected via near-field communication, so that the target log can be sent via the Bluetooth hotspot. Logs can be sent directly without a wired interface, and the device can send logs without powering off, regardless of whether the device's Bluetooth is in any network configuration state, thus improving the efficiency of log sending. Attached Figure Description
[0040] Figure 1 A flowchart illustrating a log sending method provided in an embodiment of the present invention;
[0041] Figure 2 A flowchart illustrating another log sending method provided in an embodiment of the present invention;
[0042] Figure 3 This is a schematic diagram of the structure of a log sending device provided in an embodiment of the present invention;
[0043] Figure 4 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention;
[0044] Figure 5 This is a schematic diagram of a log sending application scenario provided by an embodiment of the present invention;
[0045] Figure 6 This is a flowchart illustrating another log sending method provided in an embodiment of the present invention. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0047] To facilitate understanding of the embodiments of the present invention, further explanations and descriptions will be provided below with reference to the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of the present invention.
[0048] Figure 1 This is a flowchart illustrating a log sending method provided in an embodiment of the present invention, as shown below. Figure 1As shown, the method specifically includes:
[0049] S11. When the target device detects the target command sent by the target terminal through near-field communication, obtain the current Bluetooth network configuration status of the target device.
[0050] The log sending method provided in this embodiment of the invention is applied to a target device, which is a computer device with computing and communication functions, and can generate and record logs. The computer device may include, but is not limited to, smart home devices (e.g., smart air conditioners, smart TVs, smart cameras), servers, desktop computers, central control systems, etc. Specifically, when the target device detects a target terminal for near-field communication, it can control the release of the Bluetooth hotspot according to the Bluetooth network configuration status to send the target logs through the Bluetooth hotspot.
[0051] In this embodiment, near-field communication is NFC communication. The target device listens for NFC signals and determines whether an NFC transmitter has entered the NFC reading range of the target device. The NFC transmitter that detects the NFC signal is identified as the target terminal. The target terminal can be a mobile phone, tablet computer, or other device that supports NFC communication.
[0052] The target command sent by the target terminal is obtained through NFC communication. When the target command is to obtain the log of the target device, the Bluetooth network configuration status of the target device is obtained.
[0053] S12. Control the target device to release the Bluetooth hotspot based on the Bluetooth network configuration status.
[0054] In this embodiment, the Bluetooth network pairing status can include: timeout without pairing, waiting for pairing, and paired. In the timeout without pairing state, Bluetooth is controlled to re-release. Before release, a new hotspot name can be generated. The hotspot name can be generated by the target device and sent or displayed to the target terminal, or it can be received by the target device from the target terminal, allowing the target terminal to connect to the Bluetooth hotspot based on the hotspot name. When the target device is in the waiting for pairing state, it can directly send or display the current hotspot name to the target terminal, allowing the target terminal to search for and connect to the Bluetooth hotspot based on the hotspot name. Alternatively, a new hotspot name can be generated. When the target device is in the paired state, it indicates that the Bluetooth is currently in a mesh network state. The current mesh protocol needs to be reinitialized to the Bluetooth protocol (e.g., BLE Bluetooth Low Energy protocol) before releasing the Bluetooth hotspot. Again, a new hotspot name can be generated before release.
[0055] S13. When the target terminal is detected to be connected to a Bluetooth hotspot, the target log of the target device is sent to the target terminal according to the target instruction.
[0056] In this embodiment, when the target terminal connects to the target device's Bluetooth hotspot, and the target device detects the connection request via the Bluetooth protocol, it queries its local storage or device-generated logs. The target logs may include the device's operating status, error messages, performance data, etc. The target device sends the target logs to the target terminal in an appropriate format (e.g., text, binary, or compressed file) via the Bluetooth protocol. If the log data is large, it can be compressed or sent in batches to avoid data transmission timeouts or network congestion.
[0057] After receiving the log data, the target terminal decodes or parses it. If the log content needs to be displayed, the terminal can show the log information on the interface; if further processing is required, the log can be stored on the terminal device or transmitted to another server for analysis.
[0058] To ensure data security during transmission, logs can be encrypted, and Bluetooth security mechanisms (such as pairing, encrypted channels, etc.) can be used to protect data integrity during transmission.
[0059] In one possible implementation, if the target device's original Bluetooth network configuration status is already configured, after the target log is sent to the target terminal, the target device will switch the Bluetooth protocol back to the mesh protocol and rejoin the previously joined mesh network to restore the historical communication connection network.
[0060] The log sending method provided in this invention obtains the current Bluetooth network configuration status of the target device when it detects a target command sent by a target terminal via near-field communication; controls the target device to release its Bluetooth hotspot based on the Bluetooth network configuration status; and sends the target device's target log to the target terminal according to the target command when the target terminal is detected to be connected to the Bluetooth hotspot. Therefore, it can control the release of the Bluetooth hotspot based on the Bluetooth network configuration status when a target terminal for near-field communication is detected, so as to send the target log through the Bluetooth hotspot. This solves the problem of remote log transmission between devices and terminals, and is particularly suitable for scenarios where there is no direct wired interface. Logs can be sent directly without needing to be sent through a wired interface, and regardless of whether the device's Bluetooth is in any network configuration state, logs can be sent directly without powering off the device, improving the efficiency and success rate of log sending.
[0061] Figure 2 This is a flowchart illustrating another log sending method provided in an embodiment of the present invention, as shown below. Figure 2 As shown, the method specifically includes:
[0062] S21. When the near-field communication signal of the target terminal is detected, the target instruction contained in the near-field communication signal is obtained; it is determined whether the target instruction is used to obtain the target log of the target device; if so, the current Bluetooth network configuration status of the target device is obtained according to the target instruction.
[0063] In this embodiment, when the target terminal approaches the device, its communication signal is detected via NFC technology. These signals can carry control commands to trigger the device to transmit logs. Once the target terminal emits an NFC signal, the device can obtain the commands contained within that signal. These commands specify device actions, such as retrieving device logs or updating device status.
[0064] The decision to proceed with log retrieval is based on whether the target command is for retrieving device logs. If so, the current Bluetooth network configuration status of the target device is further queried. The device's Bluetooth network configuration status typically relates to whether it is connected to a specific network or Mesh device. If the Bluetooth network configuration status is: timed out and not configured, proceed to step S22; if the Bluetooth network configuration status is: configured, proceed to step S23; if the Bluetooth network configuration status is: waiting for configuration, proceed to step S24.
[0065] S22. When the Bluetooth network pairing status is in the timeout and non-pairing status, control the target device to turn off the Bluetooth hotspot; receive the new hotspot name sent by the target terminal; modify the historical hotspot name of the Bluetooth hotspot according to the new hotspot name, and then control the target device to release the Bluetooth hotspot again.
[0066] In this embodiment, if the device fails to complete Bluetooth network pairing within the specified time, it will enter a "timeout without pairing" state. Once it is determined that the target device is in a timeout without pairing state, the device will immediately shut down its current Bluetooth hotspot. After shutting down the hotspot, the device stops waiting for a pairing connection, avoiding power consumption and resource waste caused by prolonged hotspot operation. To facilitate re-pairing of the target terminal, the target device receives a new hotspot name sent by the target terminal via NFC. The target device's historical Bluetooth hotspot name is modified according to the new hotspot name. The new hotspot name is used for subsequent Bluetooth pairing requests. Modifying the hotspot name ensures communication security and distinguishes functions; using the original hotspot name might allow other mobile phones to automatically pair and retrieve it, resulting in the inability to obtain logs normally. The hotspot name can be generated using a combination of random numbers and specific parameters to create a one-time valid name. It will automatically shut down if the connection is not established within the time limit, and will also automatically shut down once the connection is established.
[0067] After successfully modifying the historical hotspot name, the target device is controlled to release the Bluetooth hotspot again and enter the network configuration state. This allows for quick reconfiguration of the network by turning off the Bluetooth hotspot and releasing a new hotspot name in the event of Bluetooth network configuration failure or timeout, improving the flexibility and efficiency of device management.
[0068] S23. When the Bluetooth network pairing status is "paired", control the target device to disconnect from the currently connected mesh network; after reinitializing the target device's current mesh network protocol to the Bluetooth protocol, release the Bluetooth hotspot.
[0069] In this embodiment, if the target device has already completed Bluetooth pairing and connected to the mesh network, it enters the paired state. In the paired state, the target device will actively disconnect from the current mesh network, ensuring that it no longer participates in the original mesh network communication. This helps free up device resources and avoids the inability to switch protocols due to maintaining a mesh network connection.
[0070] After the connection is interrupted, the current Mesh network protocol is reinitialized to Bluetooth. This prepares the device for a new pairing process or to establish a connection with a new Bluetooth device. Once the protocol switch is complete, the Bluetooth hotspot is released, and the device becomes available for pairing with other devices via Bluetooth.
[0071] Therefore, by automatically detecting the network configuration status and interrupting the mesh network connection, the device can quickly switch back to the Bluetooth protocol, simplifying the protocol switching process. Disconnecting the current mesh network connection ensures that the new Bluetooth network configuration will not be interfered with, avoiding connection conflicts during the configuration process.
[0072] S24. When the Bluetooth network pairing status is in the waiting network pairing status, send the current hotspot name of the Bluetooth hotspot to the target terminal; determine whether the target terminal has connected to the Bluetooth hotspot within a preset time period; if not, receive the new hotspot name sent by the target terminal; modify the historical hotspot name of the Bluetooth hotspot according to the new hotspot name, and then control the target device to release the Bluetooth hotspot again.
[0073] In this embodiment, when the Bluetooth network pairing status is "waiting for pairing," the current Bluetooth hotspot name is sent to the target terminal for connection. The device is set to a preset duration (e.g., 10 seconds) to determine whether the target terminal has connected to the Bluetooth hotspot. If the target terminal successfully connects, the step of sending target logs to the target terminal is executed.
[0074] If the target terminal fails to connect to the Bluetooth hotspot within the preset time, the device receives the new hotspot name sent by the target terminal. The historical hotspot name is updated to the new name. The target device then releases the Bluetooth hotspot again, preparing to re-receive connection requests from the target terminal. This ensures the validity of the updated hotspot name, guaranteeing a smooth subsequent network configuration process and preventing configuration failures due to name conflicts or errors. Furthermore, by dynamically receiving and modifying the hotspot name, the device can adjust the hotspot name promptly according to the actual needs of the target terminal, improving the flexibility and success rate of network configuration. By determining the terminal's connection status within a preset time while waiting for network configuration, the device avoids the complexity of subsequent operations caused by network configuration timeouts or connection failures.
[0075] In one possible implementation, when the target instruction is used to send the target log to the server, it is determined whether the target device is connected to the server; if so, the target log is sent to the server; or, when the target terminal fails to connect to the Bluetooth hotspot, the target log is sent to the server.
[0076] In this embodiment, when a target instruction requests log upload, the system first determines whether the target device has successfully connected to the server. If the target device is connected to the server, the target log is sent directly to the server. If the target device has not established a connection with the server, it will enter backup or buffer mode, waiting for the next connection attempt. To avoid losing log information when the device fails to connect to the server, the device will cache the log data locally and upload it after the connection is restored. This mechanism ensures that all important logs of the device can be successfully transmitted, reducing data loss caused by network instability.
[0077] When the target device fails to connect to the Bluetooth hotspot during Bluetooth network pairing, it will automatically determine if other available network connection methods (such as Wi-Fi or wired connection) exist. Once the target device successfully connects to another available network or server, it will automatically initiate a log upload operation, sending the target logs to the server. This mechanism ensures that even in the event of an unstable Bluetooth connection, the device can still transmit log information to the server in a timely manner, ensuring data integrity and accuracy.
[0078] To avoid losing log information when the device fails to connect to the server, the device caches log data locally and uploads it only after the connection is restored. This mechanism ensures that all important logs from the device are successfully transmitted, reducing data loss caused by network instability.
[0079] S25. Obtain the target terminal's historical processing methods for the obtained logs. The historical processing methods include: viewing locally and / or uploading to the server; determining the first log from the target logs according to the historical processing methods, and sending the first log to the server; and / or determining the second log from the target logs according to the historical processing methods, and sending the second log to the target terminal.
[0080] In this embodiment, the target terminal's historical log processing methods are first obtained. These historical processing methods include: viewing logs locally and / or uploading logs to a server. By analyzing the user's operation history, the target device can identify its log processing methods.
[0081] When the historical processing method is local viewing, the target device retrieves the first log of the first log type viewed locally. The target device then extracts the first log of the first log type from the target log and transmits it to the target terminal. The user can then view the log directly on the terminal.
[0082] When the historical processing method is upload to the server, the device obtains the second log type of the target terminal's upload to the server, extracts the second log of the second log type from the target log, and sends the second log to the server for storage and processing.
[0083] By intelligently selecting the log processing path based on historical processing methods, the device can avoid duplicate uploads or omissions of log data. Whether the user chooses to view locally or upload to the server, the system can rationally process and transmit the corresponding log data according to the needs of the target terminal, improving log management efficiency. Through both local viewing and server upload methods, the device can store important log data as needed, while preventing situations where users cannot access the logs.
[0084] As an example, such as Figure 5 The diagram illustrates a log sending application scenario provided by an embodiment of the present invention, including: a central control screen (target device) and a mobile phone (target terminal). The central control screen performs NFC identity verification on the mobile phone. Upon successful verification, it releases a Bluetooth hotspot, and the mobile phone connects to the Bluetooth hotspot to obtain logs. Figure 6 The diagram shows a flowchart of another log sending method provided by an embodiment of the present invention. The method includes: 1. The daemon process of the central control (target device) is powered on to initialize the NFC module. Since it mainly obtains the abnormal situation logs of the application, another daemon is needed to monitor the operation of the application and push logs.
[0085] 2. The central control system's daemon process will monitor NFC module data and wait for the phone to enter the reading range.
[0086] 3. The central control system's daemon process will determine whether an NFC transmitter has entered the reading range.
[0087] 4. If yes, an NFC transmitter is detected, NFC data is read and processed, and the process proceeds to step 5. Otherwise, monitoring and judgment continue, and the process returns to step 2. (At this point, the mobile phone (target terminal) needs to have NFC and Bluetooth functions enabled to perform the corresponding verification communication and obtain logs).
[0088] 5. The central control unit's daemon process verifies the read NFC data. Upon successful verification, it releases the Bluetooth hotspot according to the NFC data requirements and the device's current state. If the device is in a timeout / unconfigured state, the Bluetooth hotspot is turned off, the corresponding hotspot name is modified, and then it is released. If the device is in a waiting-for-configuration state, the hotspot name is directly modified. If the device is in a configured state (mesh state), it needs to be reinitialized to the Bluetooth protocol before releasing the hotspot.
[0089] 6. Wait for your phone to connect to the Bluetooth hotspot.
[0090] 7. After successful connection, compress the log and send it to the mobile phone via Bluetooth. Once communication is complete, automatically turn off the hotspot and return to step 2.
[0091] 8. In step 5, the user can decide whether to directly upload the logs to the server. If so, they can skip Bluetooth hotspot release and directly upload the logs to the server via Wi-Fi / wired network. NFC is used to send compressed logs and upload them to the server (this requires verifying the central control unit's network connection is normal before sending). After receiving the logs, the mobile phone can choose to directly upload the logs to the server or view the relevant log files locally.
[0092] The log transmission method provided in this invention, after identity verification via NFC, allows the device to switch from the mesh protocol back to the common Bluetooth protocol for log transmission with the mobile phone. This solves the problems of uninterrupted power supply and the need to avoid directly exposing the wired interface for log acquisition. It improves the efficiency and security of log transmission.
[0093] Figure 3 This is a schematic diagram of the structure of a log sending device provided in an embodiment of the present invention, as shown below. Figure 3 As shown, the device specifically includes:
[0094] The acquisition module 31 is used to acquire the current Bluetooth network configuration status of the target device when the target device detects a target instruction sent by the target terminal through near-field communication;
[0095] Control module 32 is used to control the target device to release the Bluetooth hotspot according to the Bluetooth network configuration status;
[0096] The sending module 33 is used to send the target log of the target device to the target terminal according to the target instruction when the target terminal is detected to be connected to the Bluetooth hotspot.
[0097] In one possible implementation, the acquisition module is specifically used to acquire the target instruction contained in the near-field communication signal when the near-field communication signal of the target terminal is detected.
[0098] Determine whether the target instruction is used to obtain the target log of the target device;
[0099] If so, the current Bluetooth network configuration status of the target device is obtained according to the target instruction. The Bluetooth network configuration status includes: timeout without network configuration, waiting for network configuration, and network configuration.
[0100] In one possible implementation, the control module is specifically used to control the Bluetooth hotspot of the target device to turn off when the Bluetooth network pairing status is a timeout and no network pairing status;
[0101] Receive the new hotspot name sent by the target terminal;
[0102] After modifying the historical hotspot name of the Bluetooth hotspot according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
[0103] In one possible implementation, the control module is specifically used to control the target device to disconnect from the currently connected mesh network when the Bluetooth pairing status is a paired status;
[0104] After reinitializing the target device's current mesh network protocol to Bluetooth, the Bluetooth hotspot is released.
[0105] In one possible implementation, the control module is specifically used to send the current hotspot name of the Bluetooth hotspot to the target terminal when the Bluetooth network configuration status is in the waiting network configuration status;
[0106] Determine whether the target terminal is connected to the Bluetooth hotspot within a preset time period;
[0107] If not, then receive the new hotspot name sent by the target terminal;
[0108] After modifying the historical hotspot name of the Bluetooth hotspot according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
[0109] In one possible implementation, the sending module is specifically used to determine whether the target device is connected to the server when the target instruction is used to send the target log to the server;
[0110] If so, the target log will be sent to the server;
[0111] Alternatively, when the target terminal fails to connect to the Bluetooth hotspot, the target log is sent to the server.
[0112] In one possible implementation, the acquisition module is further configured to acquire the target terminal's historical processing methods for the acquired logs, the historical processing methods including: local viewing and / or uploading to a server;
[0113] The sending module is further configured to determine a first log from the target log according to the historical processing method, and send the first log to the server;
[0114] The second log is determined from the target log according to the historical processing method, and the second log is sent to the target terminal.
[0115] The log sending device provided in this embodiment can be as follows: Figure 3 The apparatus shown can perform, for example Figures 1-2 This involves all the steps of the log sending method, thereby achieving... Figures 1-2 For details on the technical effects of the log sending method shown, please refer to [link / reference]. Figures 1-2 The relevant descriptions are presented concisely and will not be elaborated upon here.
[0116] Figure 4 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Figure 4 The computer device 400 shown includes at least one processor 401, a memory 402, at least one network interface 404, and other user interfaces 403. The various components in the computer device 400 are coupled together via a bus system 405. It is understood that the bus system 405 is used to implement communication between these components. In addition to a data bus, the bus system 405 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 4 The general designated all buses as Bus System 405.
[0117] The user interface 403 may include a display, keyboard, or clicking device (e.g., mouse, trackball, touchpad, or touchscreen).
[0118] It is understood that the memory 402 in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 402 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0119] In some implementations, memory 402 stores elements, executable units or data structures, or subsets thereof, or extended sets thereof: operating system 4021 and application program 4022.
[0120] The operating system 4021 includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 4022 includes various applications, such as a media player and a browser, used to implement various application functions. The program implementing the method of this embodiment can be included in the application program 4022.
[0121] In this embodiment of the invention, by calling the program or instructions stored in the memory 402, specifically the program or instructions stored in the application program 4022, the processor 401 executes the method steps provided in each method embodiment, including, for example:
[0122] When the target device detects the target command sent by the target terminal through near-field communication, it obtains the current Bluetooth network configuration status of the target device;
[0123] Control the target device to release the Bluetooth hotspot based on the Bluetooth network configuration status;
[0124] When the target terminal is detected to be connected to the Bluetooth hotspot, the target log of the target device is sent to the target terminal according to the target instruction.
[0125] In one possible implementation, when a near-field communication signal of a target terminal is detected, the target instruction contained in the near-field communication signal is acquired;
[0126] Determine whether the target instruction is used to obtain the target log of the target device;
[0127] If so, the current Bluetooth network configuration status of the target device is obtained according to the target instruction. The Bluetooth network configuration status includes: timeout without network configuration, waiting for network configuration, and network configuration.
[0128] In one possible implementation, when the Bluetooth pairing status is in the timeout and non-pairing state, the Bluetooth hotspot of the target device is turned off.
[0129] Receive the new hotspot name sent by the target terminal;
[0130] After modifying the historical hotspot name of the Bluetooth hotspot according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
[0131] In one possible implementation, when the Bluetooth pairing status is "paired", the target device is controlled to disconnect from the currently connected mesh network;
[0132] After reinitializing the target device's current mesh network protocol to Bluetooth, the Bluetooth hotspot is released.
[0133] In one possible implementation, when the Bluetooth network configuration status is in the waiting network configuration status, the current hotspot name of the Bluetooth hotspot is sent to the target terminal;
[0134] Determine whether the target terminal is connected to the Bluetooth hotspot within a preset time period;
[0135] If not, then receive the new hotspot name sent by the target terminal;
[0136] After modifying the historical hotspot name of the Bluetooth hotspot according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
[0137] In one possible implementation, when the target instruction is used to send the target log to the server, it is determined whether the target device is connected to the server;
[0138] If so, the target log will be sent to the server;
[0139] Alternatively, when the target terminal fails to connect to the Bluetooth hotspot, the target log is sent to the server.
[0140] In one possible implementation, the target terminal obtains its historical processing methods for the obtained logs, including: local viewing and / or uploading to a server;
[0141] The first log is determined from the target log according to the historical processing method, and the first log is sent to the server;
[0142] And / or, determine a second log from the target log according to the historical processing method, and send the second log to the target terminal.
[0143] The methods disclosed in the above embodiments of the present invention can be applied to processor 401, or implemented by processor 401. Processor 401 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 401 or by instructions in the form of software. The processor 401 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software units in the decoding processor. The software units may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 402. Processor 401 reads the information in memory 402 and, in conjunction with its hardware, completes the steps of the above method.
[0144] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.
[0145] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0146] The computer device provided in this embodiment may be as follows: Figure 4 The computer device shown can perform, for example Figures 1-2 This involves all the steps of the log sending method, thereby achieving... Figures 1-2 For details on the technical effects of the log sending method shown, please refer to [link / reference]. Figures 1-2 The relevant descriptions are presented concisely and will not be elaborated upon here.
[0147] This invention also provides a storage medium (computer-readable storage medium). This storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; the memory may also include combinations of the above types of memory.
[0148] One or more programs in the storage medium can be executed by one or more processors to implement the log sending method described above that is executed on the device side.
[0149] The processor is used to execute a log sending program stored in memory to implement the following steps of a log sending method executed on the device side:
[0150] When the target device detects the target command sent by the target terminal through near-field communication, it obtains the current Bluetooth network configuration status of the target device;
[0151] Control the target device to release the Bluetooth hotspot based on the Bluetooth network configuration status;
[0152] When the target terminal is detected to be connected to the Bluetooth hotspot, the target log of the target device is sent to the target terminal according to the target instruction.
[0153] In one possible implementation, when a near-field communication signal of a target terminal is detected, the target instruction contained in the near-field communication signal is acquired;
[0154] Determine whether the target instruction is used to obtain the target log of the target device;
[0155] If so, the current Bluetooth network configuration status of the target device is obtained according to the target instruction. The Bluetooth network configuration status includes: timeout without network configuration, waiting for network configuration, and network configuration.
[0156] In one possible implementation, when the Bluetooth pairing status is in the timeout and non-pairing state, the Bluetooth hotspot of the target device is turned off.
[0157] Receive the new hotspot name sent by the target terminal;
[0158] After modifying the historical hotspot name of the Bluetooth hotspot according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
[0159] In one possible implementation, when the Bluetooth pairing status is "paired", the target device is controlled to disconnect from the currently connected mesh network;
[0160] After reinitializing the target device's current mesh network protocol to Bluetooth, the Bluetooth hotspot is released.
[0161] In one possible implementation, when the Bluetooth network configuration status is in the waiting network configuration status, the current hotspot name of the Bluetooth hotspot is sent to the target terminal;
[0162] Determine whether the target terminal is connected to the Bluetooth hotspot within a preset time period;
[0163] If not, then receive the new hotspot name sent by the target terminal;
[0164] After modifying the historical hotspot name of the Bluetooth hotspot according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
[0165] In one possible implementation, when the target instruction is used to send the target log to the server, it is determined whether the target device is connected to the server;
[0166] If so, the target log will be sent to the server;
[0167] Alternatively, when the target terminal fails to connect to the Bluetooth hotspot, the target log is sent to the server.
[0168] In one possible implementation, the target terminal obtains its historical processing methods for the obtained logs, including: local viewing and / or uploading to a server;
[0169] The first log is determined from the target log according to the historical processing method, and the first log is sent to the server;
[0170] And / or, determine a second log from the target log according to the historical processing method, and send the second log to the target terminal.
[0171] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0172] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0173] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A log sending method, characterized in that, include: When the target device detects the target command sent by the target terminal through near-field communication, it obtains the current Bluetooth network configuration status of the target device; Control the target device to release the Bluetooth hotspot based on the Bluetooth network configuration status; When the target terminal is detected to be connected to the Bluetooth hotspot, the target log of the target device is sent to the target terminal according to the target instruction; When the target device detects a target command sent by the target terminal via near-field communication, the current Bluetooth network configuration status of the target device is obtained, including: When a near-field communication signal of the target terminal is detected, the target instruction contained in the near-field communication signal is obtained; Determine whether the target instruction is used to obtain the target log of the target device; If so, the current Bluetooth network configuration status of the target device is obtained according to the target instruction. The Bluetooth network configuration status includes: timeout without network configuration, waiting for network configuration, and network configuration. The step of controlling the target device to release the Bluetooth hotspot based on the Bluetooth network configuration status includes: When the Bluetooth pairing status is "paired", control the target device to disconnect from the currently connected mesh network; After reinitializing the target device's current mesh network protocol to Bluetooth, the Bluetooth hotspot is released.
2. The method according to claim 1, characterized in that, The step of controlling the target device to release the Bluetooth hotspot based on the Bluetooth network configuration status includes: When the Bluetooth pairing status is in the timeout and not paired status, control the Bluetooth hotspot of the target device to turn off; Receive the new hotspot name sent by the target terminal; After modifying the historical hotspot name of the Bluetooth hotspot according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
3. The method according to claim 1, characterized in that, The step of controlling the target device to release the Bluetooth hotspot based on the Bluetooth network configuration status includes: When the Bluetooth network configuration status is in the waiting network configuration status, the current hotspot name of the Bluetooth hotspot is sent to the target terminal; Determine whether the target terminal is connected to the Bluetooth hotspot within a preset time period; If not, then receive the new hotspot name sent by the target terminal; After modifying the historical hotspot name of the Bluetooth hotspot according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
4. The method according to claim 1, characterized in that, The method further includes: When the target instruction is used to send the target log to the server, it is determined whether the target device is connected to the server; If so, the target log will be sent to the server; Alternatively, when the target terminal fails to connect to the Bluetooth hotspot, the target log is sent to the server.
5. The method according to claim 1, characterized in that, Sending the target device's target log to the target terminal according to the target instruction includes: The target terminal obtains its historical processing methods for the acquired logs, including: local viewing and / or uploading to a server; The first log is determined from the target log according to the historical processing method, and the first log is sent to the server; And / or, determine a second log from the target log according to the historical processing method, and send the second log to the target terminal.
6. A log sending device, characterized in that, include: The acquisition module is used to acquire the current Bluetooth network configuration status of the target device when the target device detects a target command sent by the target terminal through near-field communication. The control module is used to control the target device to release the Bluetooth hotspot according to the Bluetooth network configuration status; The sending module is used to send the target log of the target device to the target terminal according to the target instruction when the target terminal is detected to be connected to the Bluetooth hotspot; The acquisition module is specifically used to acquire the target instruction contained in the near-field communication signal when the near-field communication signal of the target terminal is detected. Determine whether the target instruction is used to obtain the target log of the target device; If so, the current Bluetooth network configuration status of the target device is obtained according to the target instruction. The Bluetooth network configuration status includes: timeout without network configuration, waiting for network configuration, and network configuration. The control module is specifically used to control the target device to disconnect from the currently connected mesh network when the Bluetooth network pairing status is already paired. After reinitializing the target device's current mesh network protocol to Bluetooth, the Bluetooth hotspot is released.
7. A computer device, characterized in that, include: A processor and a memory, the processor being configured to execute a log sending program stored in the memory to implement the log sending method according to any one of claims 1 to 5.
8. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the log sending method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Log sending method, terminal and computer readable storage medium
CN107179978A
Equipment testing method and device, storage medium and electronic device
CN116033471A