Log sending method and device, computer equipment and storage medium
By detecting the Bluetooth distribution status of the smart device and releasing Bluetooth hotspots, the problem that smart devices cannot directly obtain logs in abnormal situations is solved, and efficient log transmission without power outage is achieved.
Patent Information
- Application Number
- CN202411868002.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-18
AI Technical Summary
Existing smart devices cannot directly connect to the USB interface to obtain log information when encountering abnormal situations, and after Bluetooth distribution, mobile phones and other terminals cannot directly obtain logs, resulting in low log transmission efficiency.
By detecting the command sent by the target terminal through near-field communication, the Bluetooth distribution status of the target device is obtained, and the Bluetooth hotspot is released according to this status. When the target terminal connects to a Bluetooth hotspot, the target device's log is sent.
It realizes efficient log transmission without the need to pass through a wired interface and without the need for power outage of the equipment, which improves the efficiency and success rate of log transmission.
Smart Images

Figure CN119729432A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of communication technology, and in particular to a log sending method, device, computer equipment, and storage medium. Background Art
[0002] Existing smart devices (for example, central control systems) need to be dustproof and waterproof due to the influence of factors such as humid weather. Therefore, the USB interface of the device is designed to be hidden inside the board. When encountering abnormal situations, it is impossible to directly connect to the USB interface to obtain log information. The device needs to be powered off until the abnormal situation returns to normal before it can be connected through the USB again. The efficiency of obtaining logs is very low.
[0003] After the Bluetooth network is configured, the device will switch to the Mesh protocol (Bluetooth private protocol) to control the Bluetooth Mesh device. In this case, mobile phones and other terminals cannot directly obtain logs. Although NFC technology can transmit data at a short distance, its transmission rate is slow and it is only applicable to small amounts of data. 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 terminals has become an urgent problem to be solved. Summary of the invention
[0004] In view of this, in order to solve the above-mentioned technical problem of improving the efficiency of log sending, the embodiments of the present invention provide a log sending method, apparatus, computer equipment and storage medium.
[0005] In a first aspect, an embodiment of the present invention provides a log sending method, including:
[0006] When the target device detects a target instruction sent by the target terminal through near field communication, the current Bluetooth network configuration state of the target device is obtained;
[0007] Control the target device to release the Bluetooth hotspot according to the Bluetooth network configuration status;
[0008] When it is detected that the target terminal is connected to the Bluetooth hotspot, the target log of the target device is sent to the target terminal according to the target instruction.
[0009] In a possible implementation, when the target device detects the target instruction sent by the target terminal through near field communication, obtaining the current Bluetooth network configuration state of the target device includes:
[0010] When a near field communication signal of a 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 state of the target device is obtained according to the target instruction, and the Bluetooth network configuration state includes: timeout and unconfigured network state, waiting network configuration state, and configured network state.
[0013] In a possible implementation, controlling the target device to release the Bluetooth hotspot according to the Bluetooth network configuration state includes:
[0014] When the Bluetooth network configuration state is a timeout and unconfigured state, controlling the Bluetooth hotspot of the target device to be closed;
[0015] Receiving a new hotspot name sent by the target terminal;
[0016] After the historical hotspot name of the Bluetooth hotspot is modified according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
[0017] In a possible implementation, controlling the target device to release the Bluetooth hotspot according to the Bluetooth network configuration state includes:
[0018] When the Bluetooth network configuration state is a configured state, controlling the target device to disconnect from the currently connected mesh network;
[0019] After reinitializing the current mesh network protocol of the target device to the Bluetooth protocol, the Bluetooth hotspot is released.
[0020] In a possible implementation, controlling the target device to release the Bluetooth hotspot according to the Bluetooth network configuration state includes:
[0021] When the Bluetooth network configuration state is a waiting network configuration state, sending the current hotspot name of the Bluetooth hotspot to the target terminal;
[0022] Determine whether the target terminal is connected to the Bluetooth hotspot within a preset time period;
[0023] If not, receiving the new hotspot name sent by the target terminal;
[0024] After the historical hotspot name of the Bluetooth hotspot is modified according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
[0025] In a possible implementation, the method further includes:
[0026] When the target instruction is used to send the target log to the server, determining whether the target device is connected to the server;
[0027] If yes, sending the target log to the server;
[0028] Or, when the target terminal fails to connect to the Bluetooth hotspot, the target log is sent to the server.
[0029] In a possible implementation, sending the target log of the target device to the target terminal according to the target instruction includes:
[0030] Obtaining a historical processing method of the target terminal for the acquired log, wherein the historical processing method includes: local viewing and / or uploading to a server;
[0031] determining a first log from the target log according to the historical processing mode, and sending the first log to the server;
[0032] And / or, determining a second log from the target log according to the historical processing manner, and sending the second log to the target terminal.
[0033] In a second aspect, an embodiment of the present invention provides a log sending device, including:
[0034] An acquisition module, used for acquiring the current Bluetooth network configuration state of the target device when the target device detects the target instruction sent by the target terminal through near field communication;
[0035] A control module, used for controlling the target device to release the Bluetooth hotspot according to the Bluetooth network configuration state;
[0036] The sending module is used to send the target log of the target device to the target terminal according to the target instruction when it is detected that the target terminal is connected to the Bluetooth hotspot.
[0037] In a third aspect, an embodiment of the present invention provides a computer device, comprising: a processor and a memory, wherein the processor is used 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] In a fourth aspect, an embodiment of the present invention provides a storage medium, wherein the storage medium stores one or more programs, and the one or more programs 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 by the embodiment of the present invention obtains the current Bluetooth network configuration state of the target device when the target device detects the target instruction sent by the target terminal through near field communication; controls the target device to release the Bluetooth hotspot according to the Bluetooth network configuration state; and sends the target log of the target device to the target terminal according to the target instruction when it is detected that the target terminal is connected to the Bluetooth hotspot. As a result, when the target terminal of near field communication is detected, the Bluetooth hotspot can be released according to the Bluetooth network configuration state control to send the target log through the Bluetooth hotspot. There is no need to send logs through a wired interface, and when the Bluetooth of the device is in any network configuration state, there is no need to power off the device, and the log can be sent directly, thereby improving the efficiency of log sending. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A flow chart of a log sending method provided by an embodiment of the present invention;
[0041] Figure 2 A flow chart of another log sending method provided by an embodiment of the present invention;
[0042] Figure 3 A schematic diagram of the structure of a log sending device provided by an embodiment of the present invention;
[0043] Figure 4 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention;
[0044] Figure 5 A schematic diagram of a log sending application scenario provided by an embodiment of the present invention;
[0045] Figure 6 A flowchart of another log sending method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] To facilitate understanding of the embodiments of the present invention, specific embodiments will be further explained below in conjunction with the accompanying drawings. The embodiments do not constitute a limitation on the embodiments of the present invention.
[0048] Figure 1 A flow chart of a log sending method provided by an embodiment of the present invention is as follows: Figure 1As shown, the method specifically includes:
[0049] S11. When the target device detects a target instruction sent by the target terminal through near field communication, the current Bluetooth network configuration state of the target device is obtained.
[0050] The log sending method provided in an embodiment of the present 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 (for example, 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, the Bluetooth hotspot can be released according to the Bluetooth network configuration status to control the release of the target log through the Bluetooth hotspot.
[0051] In this embodiment, near field communication is NFC communication. The target device monitors NFC signals, determines whether an NFC transmitter enters the NFC reading range of the target device, and determines the NFC transmitter that detects the NFC signal as the target terminal. The target terminal can be a mobile phone, tablet computer, or other device that supports NFC communication.
[0052] The target instruction sent by the target terminal is obtained through NFC communication. When the target instruction is an instruction 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 according to the Bluetooth network configuration status.
[0054] In this embodiment, the Bluetooth network configuration state may include: a timeout and unconfigured network state, a waiting network configuration state, and a configured network state. When the timeout and unconfigured network state occurs, the Bluetooth is controlled to be released again, and the hotspot name may be regenerated before the release, wherein the hotspot name may be sent or displayed to the target terminal after being generated by the target device, or the target device may receive the hotspot name generated by the target terminal, so that the target terminal can connect to the Bluetooth hotspot according to the hotspot name. When the target device is in the waiting network configuration state, the current hotspot name may be sent or displayed directly to the target terminal, so that the target terminal may search and connect to the Bluetooth hotspot according to the hotspot name, or the hotspot name may be regenerated. When the target device is in the configured network state, it means that the current Bluetooth is in the mesh network state, that is, the mesh state, and the current mesh protocol needs to be reinitialized to the Bluetooth protocol (for example, the BLE Bluetooth low energy protocol) before the Bluetooth hotspot is released. Similarly, a new hotspot name may be generated before the release.
[0055] S13: When it is detected that the target terminal is connected to the 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 is connected to the Bluetooth hotspot of the target device, the target device detects the connection request through the Bluetooth protocol and queries the logs stored locally or generated by the device. The target log may include the operating status, error information, performance data, etc. of the device. The target device sends the target log to the target terminal in an appropriate format (e.g., text, binary, or compressed file) through the Bluetooth protocol. If the log data is large, it can be compressed or sent in batches to avoid data transmission timeout 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 display the log information on the interface; if further processing is required, the log can be stored on the terminal device or transmitted to other servers for analysis.
[0058] To ensure the security of data in transmission, logs can be encrypted and Bluetooth security mechanisms (such as pairing, encrypted channels, etc.) can be used to protect the integrity of data during transmission.
[0059] In a possible implementation, if the original Bluetooth network configuration state of the target device is already configured, after the target log is sent to the target terminal, the target device changes the Bluetooth protocol to the mesh protocol and rejoins the mesh network that it has joined in the past, so as to restore the historical communication connection network.
[0060] The log sending method provided by the embodiment of the present invention obtains the current Bluetooth network configuration state of the target device when the target device detects the target instruction sent by the target terminal through near field communication; controls the target device to release the Bluetooth hotspot according to the Bluetooth network configuration state; and sends the target log of the target device to the target terminal according to the target instruction when it is detected that the target terminal is connected to the Bluetooth hotspot. As a result, when the target terminal of near field communication is detected, the Bluetooth hotspot can be released according to the Bluetooth network configuration state control to send the target log through the Bluetooth hotspot. The problem of remote log transmission between the device and the terminal is solved, and it is particularly suitable for device scenarios without direct wired interfaces. There is no need to send logs through a wired interface, and when the Bluetooth of the device is in any network configuration state, there is no need to power off the device, and the log can be sent directly, thereby improving the efficiency of log sending and the success rate of log sending.
[0061] Figure 2 A flow chart of another log sending method provided by an embodiment of the present invention is as follows: Figure 2 As shown, the method specifically includes:
[0062] S21. When a near field communication signal of a target terminal is detected, a target instruction contained in the near field communication signal is obtained; and it is determined whether the target instruction is used to obtain a target log of a 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, the communication signal of the target terminal is detected by NFC technology. These signals can carry control instructions to trigger the device to transmit logs. Once the target terminal sends an NFC signal, the device can obtain the instructions contained in the signal. The instructions are used to specify device behavior, such as obtaining device logs, updating device status, etc.
[0064] By judging whether the target instruction is an instruction to obtain device logs, it is decided whether to perform subsequent log acquisition operations. If so, the current Bluetooth network configuration status of the target device will be further queried. The Bluetooth network configuration status of the device usually involves whether it is connected to a specific network or Mesh device. If the Bluetooth network configuration status is: timeout and unconfigured, execute step S22; if the Bluetooth network configuration status is: configured, execute step S23; if the Bluetooth network configuration status is: waiting for network configuration, execute step S24.
[0065] S22. When the Bluetooth network configuration state is a timeout and unconfigured state, control the target device's Bluetooth hotspot to be closed; receive a 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, when the device fails to complete the network configuration within the specified time during the Bluetooth network configuration process, the device will enter the "timeout and unconfigured" state. Once it is determined that the target device is in the timeout and unconfigured state, the device will be immediately controlled to close the current Bluetooth hotspot. After closing the hotspot, the device stops waiting for the network configuration connection to avoid power consumption and resource waste caused by opening the hotspot for a long time. In order to facilitate the re-configuration of the target terminal, the target device receives the new hotspot name sent by the target terminal via NFC. Modify the historical hotspot name of the target device Bluetooth according to the new hotspot name. The new hotspot name is used for subsequent Bluetooth network configuration requests. Modifying the hotspot name is used to ensure communication security and to distinguish functions. The original hotspot name may be retrieved by other mobile phones for automatic network configuration, resulting in the inability to obtain logs normally. The hotspot name can be generated by a combination of random numbers + specific parameters to generate a one-time valid name. It will be automatically closed if it does not connect after a timeout, and it will also be automatically closed after the connection is completed.
[0067] After successfully modifying the historical hotspot name, the target device is controlled to re-release the Bluetooth hotspot and enter the waiting network configuration state. In this way, when the Bluetooth network configuration fails or times out, the Bluetooth hotspot can be closed and a new hotspot name can be re-released to achieve rapid network configuration, thereby improving the flexibility and efficiency of device management.
[0068] S23. When the Bluetooth network configuration state is the configured state, control the target device to disconnect from the currently connected mesh network; reinitialize the current mesh network protocol of the target device to the Bluetooth protocol, and then release the Bluetooth hotspot.
[0069] In this embodiment, if the target device has completed Bluetooth network configuration and connected to the mesh network, it enters the configured state. In the configured state, the target device will actively disconnect from the current mesh network to ensure that the target device no longer participates in the original mesh network communication. This helps to release the device's resources and avoid the inability to switch protocols due to maintaining the mesh network connection.
[0070] After the connection is interrupted, the current mesh network protocol (Mesh protocol) is reinitialized to the Bluetooth protocol. Prepare for a new network configuration process or establish a connection with a new Bluetooth device. After the protocol switch is completed, the Bluetooth hotspot is released, and the device becomes available for network configuration, which can be used by other terminal devices for Bluetooth network configuration connection.
[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 operation process. The device interrupts the current mesh network connection to ensure that the new Bluetooth network configuration will not be disturbed, avoiding connection conflicts during the network configuration process.
[0072] S24. When the Bluetooth network configuration state is in the waiting network configuration state, the current hotspot name of the Bluetooth hotspot is sent to the target terminal; it is determined whether the target terminal is connected to the Bluetooth hotspot within a preset time period; if not, a new hotspot name sent by the target terminal is received; 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.
[0073] In this embodiment, when the Bluetooth network configuration state is waiting for network configuration, the current Bluetooth hotspot name is sent to the target terminal for the target terminal to connect. The device sets a preset time (for example, 10 seconds) to determine whether the target terminal is connected to the Bluetooth hotspot within this time. If the target terminal is successfully connected, the step of sending the target log to the target terminal is executed.
[0074] If the target terminal fails to connect to the Bluetooth hotspot within the preset time, receive the new hotspot name sent by the target terminal. Update the historical hotspot name of the Bluetooth hotspot to the new hotspot name. Control the target device to release the Bluetooth hotspot again and prepare to receive the connection request of the target terminal again. In this way, the validity of the device hotspot name after the update can be ensured, and the subsequent network configuration process can be carried out smoothly, thereby avoiding network configuration failures caused by name conflicts or errors during connection. And by dynamically receiving and modifying the hotspot name, the device can adjust the hotspot name in time according to the actual needs of the target terminal, thereby improving the flexibility and success rate of network configuration. The device judges the terminal connection status at a preset time while waiting for network configuration, avoiding the complexity of subsequent operations caused by network configuration timeout or connection failure.
[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 the target instruction requires uploading logs, it is first determined whether the target device has successfully connected to the server. If the target device is connected to the server, the target log is directly sent to the server. If the target device is not connected to the server, the target device will enter the backup or buffer mode and wait 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 can ensure that all important logs of the device can be successfully transmitted and reduce data loss caused by network instability.
[0077] When the target terminal fails to successfully connect to the Bluetooth hotspot during Bluetooth network pairing, the target device will automatically determine whether there are other available network connection methods (such as Wi-Fi or wired connection). Once the target device successfully connects to other available networks or servers, it will automatically start the log upload operation and send the target log to the server. This mechanism ensures that even if the Bluetooth connection is unstable, the device can still transmit the log information to the server in a timely manner, ensuring the integrity and accuracy of the data.
[0078] 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 and reduces data loss caused by network instability.
[0079] S25. Obtain the historical processing method of the target terminal for the acquired log, the historical processing method including: local viewing and / or uploading to the server; determining a first log from the target log according to the historical processing method, and sending the first log to the server; and / or determining a second log from the target log according to the historical processing method, and sending the second log to the target terminal.
[0080] In this embodiment, the target terminal first obtains the historical processing method of the log. The historical processing method includes: viewing the log through the local terminal, and / or uploading the log to the server. The target device can identify the processing method of its log by analyzing the user operation history.
[0081] When the history processing mode is local viewing, the first log type viewed locally by the target terminal is obtained, the target device extracts the first log of the first log type from the target log, and transmits the first log to the target terminal. The user can view the log directly on the terminal.
[0082] When the historical processing mode is to upload to the server, the target terminal uploads the second log type of the server, then the device 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 repeated uploading or missing log data. Whether the user chooses to view locally or upload to the server, the system can reasonably process and transmit the corresponding log data according to the needs of the target terminal, improving the efficiency of log management. Through local viewing and uploading to the server, the device can store important log data as needed, while avoiding the situation where users cannot access the logs.
[0084] As an example, Figure 5 The figure shows a schematic diagram of 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, and releases the Bluetooth hotspot when the verification is successful. The mobile phone obtains logs after connecting to the Bluetooth hotspot. Figure 6 The figure shows a flow chart of another log sending method provided by an embodiment of the present invention, the method comprising: 1. The daemon process of the central control (target device) will power on and initialize the NFC module. Since it is mainly used to obtain the abnormal situation log of the application, another daemon is required to monitor the operation of the application and push the log.
[0085] 2. The central control daemon will monitor the NFC module data and wait for the phone to enter the reading range.
[0086] 3. The central control daemon will determine whether there is an NFC transmitter within the reading range.
[0087] 4. If yes, the NFC transmitter is detected, the NFC data is read and processed, and the process goes to step 5. Otherwise, the monitoring and judgment continues, and the process goes back to step 2. (At this time, the mobile phone (target terminal) needs to turn on the NFC and Bluetooth functions to perform the corresponding verification communication and obtain the log).
[0088] 5. The central control daemon will verify the read NFC data. After verification, the Bluetooth hotspot will be released according to the NFC data requirements and the current status of the device. When in the timeout and unconfigured state, the Bluetooth hotspot is closed and the corresponding hotspot name is modified before it is released. When in the waiting state for network configuration, directly modify the hotspot name. When in the configured state (mesh state), it is necessary to re-initialize to the Bluetooth protocol before releasing the hotspot.
[0089] 6. Wait for your phone to connect to the Bluetooth hotspot.
[0090] 7. After the connection is successful, the log will be compressed and sent to the mobile phone via Bluetooth. When the communication is completed, the hotspot will be automatically closed and return to step 2.
[0091] 8. In step 5, the user can decide whether to upload the log to the server directly. If so, the user can upload the log to the server directly via WIFI / wired network without releasing the Bluetooth hotspot. At this time, NFC is used to send compressed logs and upload them to the server. At this time, it is necessary to determine whether the central control network is normal before sending. After the mobile phone receives the log, it can also choose to upload the log directly to the server, or choose to view the relevant log files locally.
[0092] The log sending method provided by the embodiment of the present invention can allow the device to switch from the mesh protocol back to the general Bluetooth protocol to transmit specific logs with the mobile phone after identity verification through NFC, which can solve the problem of obtaining logs without power failure and without directly exposing the wired interface, thereby improving the efficiency and security of log sending.
[0093] Figure 3 A structural diagram of a log sending device provided by an embodiment of the present invention is shown in FIG. Figure 3 As shown, the device specifically includes:
[0094] The acquisition module 31 is used to acquire the current Bluetooth network configuration state of the target device when the target device detects the target instruction sent by the target terminal through the near field communication;
[0095] A control module 32, used to control the target device to release the Bluetooth hotspot according to the Bluetooth network configuration state;
[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 it is detected that the target terminal is connected to the Bluetooth hotspot.
[0097] In a possible implementation, the acquisition module is specifically configured to acquire a target instruction included in a near field communication signal when a near field communication signal of a target terminal is detected;
[0098] Determining whether the target instruction is used to obtain a target log of the target device;
[0099] If so, the current Bluetooth network configuration state of the target device is obtained according to the target instruction, and the Bluetooth network configuration state includes: timeout and unconfigured network state, waiting network configuration state, and configured network state.
[0100] In a possible implementation, the control module is specifically configured to control the Bluetooth hotspot of the target device to be turned off when the Bluetooth network configuration state is a timeout and unconfigured state;
[0101] Receiving a new hotspot name sent by the target terminal;
[0102] After the historical hotspot name of the Bluetooth hotspot is modified according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
[0103] In a possible implementation, the control module is specifically configured to control the target device to disconnect from the currently connected mesh network when the Bluetooth network configuration state is a configured network state;
[0104] After reinitializing the current mesh network protocol of the target device to the Bluetooth protocol, the Bluetooth hotspot is released.
[0105] In a possible implementation, the control module is specifically configured to send the current hotspot name of the Bluetooth hotspot to the target terminal when the Bluetooth network configuration state is a waiting network configuration state;
[0106] Determine whether the target terminal is connected to the Bluetooth hotspot within a preset time period;
[0107] If not, receiving the new hotspot name sent by the target terminal;
[0108] After the historical hotspot name of the Bluetooth hotspot is modified according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
[0109] In a possible implementation manner, the sending module is specifically configured 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 yes, sending the target log to the server;
[0111] Or, when the target terminal fails to connect to the Bluetooth hotspot, the target log is sent to the server.
[0112] In a possible implementation, the acquisition module is further used to acquire a historical processing method of the target terminal for the acquired log, and the historical processing method includes: local viewing and / or uploading to a server;
[0113] The sending module is further used to determine a first log from the target log according to the historical processing mode, and send the first log to the server;
[0114] A second log is determined from the target log according to the historical processing mode, and the second log is sent to the target terminal.
[0115] The log sending device provided in this embodiment may be as follows Figure 3 The device shown in FIG. 1 can perform the following steps: Figure 1-2 All steps of the log sending method in the implementation Figure 1-2 For details on the technical effects of the log sending method shown, please refer to Figure 1-2 For the sake of brevity, the relevant description is not repeated here.
[0116] Figure 4 A schematic diagram of the structure of a computer device provided by 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 achieve connection and communication between these components. In addition to the data bus, the bus system 405 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 405 is not shown in FIG. Figure 4 Various buses are labeled as bus system 405 .
[0117] The user interface 403 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).
[0118] It can be understood that the memory 402 in the embodiment of the present invention can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a 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 dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (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, the memory 402 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 4021 and application programs 4022 .
[0120] The operating system 4021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 4022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present invention can be included in the application 4022.
[0121] In the embodiment of the present invention, by calling the program or instruction stored in the memory 402, specifically, the program or instruction stored in the application 4022, the processor 401 is used to execute the method steps provided by each method embodiment, for example, including:
[0122] When the target device detects a target instruction sent by the target terminal through near field communication, the current Bluetooth network configuration state of the target device is obtained;
[0123] Control the target device to release the Bluetooth hotspot according to the Bluetooth network configuration status;
[0124] When it is detected that the target terminal is 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 a possible implementation, when a near field communication signal of a target terminal is detected, a target instruction included in the near field communication signal is acquired;
[0126] Determining whether the target instruction is used to obtain a target log of the target device;
[0127] If so, the current Bluetooth network configuration state of the target device is obtained according to the target instruction, and the Bluetooth network configuration state includes: timeout and unconfigured network state, waiting network configuration state, and configured network state.
[0128] In a possible implementation, when the Bluetooth network configuration state is a timeout and unconfigured state, controlling the Bluetooth hotspot of the target device to be closed;
[0129] Receiving a new hotspot name sent by the target terminal;
[0130] After the historical hotspot name of the Bluetooth hotspot is modified according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
[0131] In a possible implementation, when the Bluetooth network configuration state is a configured state, controlling the target device to disconnect from the currently connected mesh network;
[0132] After reinitializing the current mesh network protocol of the target device to the Bluetooth protocol, the Bluetooth hotspot is released.
[0133] In a possible implementation, when the Bluetooth network configuration state is a waiting network configuration state, 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, receiving the new hotspot name sent by the target terminal;
[0136] After the historical hotspot name of the Bluetooth hotspot is modified according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
[0137] In a 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 yes, sending the target log to the server;
[0139] Or, when the target terminal fails to connect to the Bluetooth hotspot, the target log is sent to the server.
[0140] In a possible implementation, a historical processing method of the target terminal for the acquired log is obtained, and the historical processing method includes: local viewing and / or uploading to a server;
[0141] determining a first log from the target log according to the historical processing mode, and sending the first log to the server;
[0142] And / or, determining a second log from the target log according to the historical processing manner, and sending the second log to the target terminal.
[0143] The method disclosed in the above embodiment of the present invention can be applied to the processor 401, or implemented by the processor 401. The 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 hardware integrated logic circuit in the processor 401 or the instruction in the form of software. The above processor 401 can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor can be executed. The software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 402, and the processor 401 reads the information in the memory 402 and completes the steps of the above method in combination with its hardware.
[0144] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPDevice, DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.
[0145] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0146] The computer device provided in this embodiment may be as follows Figure 4 The computer device shown in , can execute Figure 1-2 All steps of the log sending method in the implementation Figure 1-2 For details on the technical effects of the log sending method shown, please refer to Figure 1-2 For the sake of brevity, the relevant description is not repeated here.
[0147] The embodiment of the present invention also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.
[0148] When one or more programs in the storage medium can be executed by one or more processors, the log sending method executed on the device side can be implemented.
[0149] The processor is used to execute the log sending program stored in the memory to implement the following steps of the log sending method executed on the device side:
[0150] When the target device detects a target instruction sent by the target terminal through near field communication, the current Bluetooth network configuration state of the target device is obtained;
[0151] Control the target device to release the Bluetooth hotspot according to the Bluetooth network configuration status;
[0152] When it is detected that the target terminal is 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 a possible implementation, when a near field communication signal of a target terminal is detected, a target instruction included in the near field communication signal is acquired;
[0154] Determining whether the target instruction is used to obtain a target log of the target device;
[0155] If so, the current Bluetooth network configuration state of the target device is obtained according to the target instruction, and the Bluetooth network configuration state includes: timeout and unconfigured network state, waiting network configuration state, and configured network state.
[0156] In a possible implementation, when the Bluetooth network configuration state is a timeout and unconfigured state, controlling the Bluetooth hotspot of the target device to be closed;
[0157] Receiving a new hotspot name sent by the target terminal;
[0158] After the historical hotspot name of the Bluetooth hotspot is modified according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
[0159] In a possible implementation, when the Bluetooth network configuration state is a configured state, controlling the target device to disconnect from the currently connected mesh network;
[0160] After reinitializing the current mesh network protocol of the target device to the Bluetooth protocol, the Bluetooth hotspot is released.
[0161] In a possible implementation, when the Bluetooth network configuration state is a waiting network configuration state, 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, receiving the new hotspot name sent by the target terminal;
[0164] After the historical hotspot name of the Bluetooth hotspot is modified according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
[0165] In a 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 yes, sending the target log to the server;
[0167] Or, when the target terminal fails to connect to the Bluetooth hotspot, the target log is sent to the server.
[0168] In a possible implementation, a historical processing method of the target terminal for the acquired log is obtained, and the historical processing method includes: local viewing and / or uploading to a server;
[0169] determining a first log from the target log according to the historical processing mode, and sending the first log to the server;
[0170] And / or, determining a second log from the target log according to the historical processing manner, and sending the second log to the target terminal.
[0171] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0172] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0173] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method 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 in the scope of protection of the present invention.
Claims
1. A log sending method, characterized in that: include: When the target device detects a target instruction sent by the target terminal through near field communication, the current Bluetooth network configuration state of the target device is obtained; Control the target device to release the Bluetooth hotspot according to the Bluetooth network configuration status; When it is detected that the target terminal is connected to the Bluetooth hotspot, the target log of the target device is sent to the target terminal according to the target instruction.
2. The method according to claim 1, characterized in that When the target device detects the target instruction sent by the target terminal through near field communication, obtaining the current Bluetooth network configuration state of the target device includes: When a near field communication signal of a target terminal is detected, obtaining a target instruction contained in the near field communication signal; Determining whether the target instruction is used to obtain a target log of the target device; If so, the current Bluetooth network configuration state of the target device is obtained according to the target instruction, and the Bluetooth network configuration state includes: timeout and unconfigured network state, waiting network configuration state, and configured network state.
3. The method according to claim 2, characterized in that The controlling the target device to release the Bluetooth hotspot according to the Bluetooth network configuration state includes: When the Bluetooth network configuration state is a timeout and unconfigured state, controlling the Bluetooth hotspot of the target device to be closed; Receiving a new hotspot name sent by the target terminal; After the historical hotspot name of the Bluetooth hotspot is modified according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
4. The method according to claim 2, characterized in that The controlling the target device to release the Bluetooth hotspot according to the Bluetooth network configuration state includes: When the Bluetooth network configuration state is a configured state, controlling the target device to disconnect from the currently connected mesh network; After reinitializing the current mesh network protocol of the target device to the Bluetooth protocol, the Bluetooth hotspot is released.
5. The method according to claim 2, characterized in that: The controlling the target device to release the Bluetooth hotspot according to the Bluetooth network configuration state includes: When the Bluetooth network configuration state is a waiting network configuration state, sending the current hotspot name of the Bluetooth hotspot to the target terminal; Determine whether the target terminal is connected to the Bluetooth hotspot within a preset time period; If not, receiving the new hotspot name sent by the target terminal; After the historical hotspot name of the Bluetooth hotspot is modified according to the new hotspot name, the target device is controlled to release the Bluetooth hotspot again.
6. The method according to claim 1, characterized in that The method further comprises: When the target instruction is used to send the target log to the server, determining whether the target device is connected to the server; If yes, sending the target log to the server; Or, when the target terminal fails to connect to the Bluetooth hotspot, the target log is sent to the server.
7. The method according to claim 1, characterized in that The sending the target log of the target device to the target terminal according to the target instruction includes: Obtaining a historical processing method of the target terminal for the acquired log, wherein the historical processing method includes: local viewing and / or uploading to a server; determining a first log from the target log according to the historical processing mode, and sending the first log to the server; And / or, determining a second log from the target log according to the historical processing manner, and sending the second log to the target terminal.
8. A log sending device, characterized in that: include: An acquisition module, used for acquiring the current Bluetooth network configuration state of the target device when the target device detects the target instruction sent by the target terminal through near field communication; A control module, used for controlling the target device to release the Bluetooth hotspot according to the Bluetooth network configuration state; The sending module is used to send the target log of the target device to the target terminal according to the target instruction when it is detected that the target terminal is connected to the Bluetooth hotspot.
9. A computer device, characterized in that: include: A processor and a memory, wherein the processor is used to execute a log sending program stored in the memory to implement the log sending method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the log sending method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Control method and device for synchronously updating log records of information receivers
CN102055775A
Log sending method, terminal and computer readable storage medium
CN107179978A
An abnormal log obtaining method and system for wearable equipment
CN109558261A
Unmanned aerial vehicle flight log uploading method and device, unmanned aerial vehicle and storage medium
CN113112640A
Equipment testing method and device, storage medium and electronic device
CN116033471A