Data acquisition method and device, terminal equipment and computer readable storage medium
By obtaining the broadcast information and network testing of the terminal equipment, real-time data is automatically obtained from the server, which solves the problems of low update efficiency and poor real-time performance of the terminal equipment, and realizes automatic real-time data update.
Patent Information
- Application Number
- CN202310432285.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-20
- Publication Date
- 2024-10-22
AI Technical Summary
The terminal device cannot automatically update real-time data, resulting in low update efficiency and poor real-time performance, especially when the SIM card is not installed.
By obtaining the broadcast information of the terminal device, determine whether it is normally connected to the network, and obtain and output real-time data to the server when connecting to the network, including testing using preset commands and network parameters, sending data packets to obtain real-time data, and satisfying Update data under certain conditions.
It enables terminal devices to automatically obtain real-time data when connected to the network, improves real-time performance and update efficiency, and reduces reliance on manual operations.
Smart Images

Figure CN118828795A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a data acquisition method, apparatus, terminal equipment and computer-readable storage medium. Background Art
[0002] Generally, the functions related to obtaining real-time data such as time zone, weather, and location depend on the related services provided by the operator of the SIM card (Subscriber Identity Module) in the terminal device.
[0003] In actual applications, there are terminal devices that cannot be installed with SIM cards, such as smart interactive tablets. For such terminal devices, to achieve the function of obtaining real-time data, it is necessary to manually click on a third-party application to obtain real-time data from the third-party application, that is, the terminal device updates the real-time data relying on manual operation. In this case, the update efficiency is low and the real-time performance is poor. Summary of the invention
[0004] The present application provides a data acquisition method, apparatus, terminal device and computer-readable storage medium, aiming to solve the problem that the terminal device relies on manual operation to update real-time data, and has low updating efficiency and poor real-time performance.
[0005] In a first aspect, the present application provides a data acquisition method, which is applied to a data acquisition device. The data acquisition method includes:
[0006] Get the information broadcast by the terminal device;
[0007] Determine whether the terminal device is normally connected to the network based on the broadcast information;
[0008] When it is determined that the terminal device is normally connected to the network, first real-time data is obtained from the server, and the first real-time data is output to the terminal device.
[0009] In one embodiment, the step of determining whether the terminal device has normally accessed the network according to the broadcast information includes:
[0010] Obtain network parameters of the network to which the terminal device is connected based on the broadcast information;
[0011] Test the network based on preset commands and network parameters to obtain test results;
[0012] Determine whether the terminal device is connected to the network normally based on the test results.
[0013] In one embodiment, the step of obtaining first real-time data from the server includes:
[0014] Sending a first data packet to the server, the first data packet including a device identification of the terminal device, a preset check value, and a command for obtaining the first real-time data, the device identification and the preset check value being used by the server for communication verification;
[0015] Obtain a second data packet sent by the server, and obtain a field corresponding to a preset position in the second data packet;
[0016] Get the first real-time data from the field.
[0017] In one embodiment, after the step of outputting the first real-time data to the terminal device, the method further includes:
[0018] Obtain target parameters, which include the current time point and / or network address;
[0019] When the target parameters meet the preset conditions, second real-time data is obtained from the server and output to the terminal device, wherein the interval between the current time point and the time point when the real-time data was last obtained reaches the preset interval, and / or the network address corresponding to the network accessed by the terminal device changes, and the target parameters meet the preset conditions.
[0020] In one embodiment, the step of determining whether the terminal device has normally accessed the network according to the broadcast information includes:
[0021] Determining whether the broadcasted information includes network connection information of the terminal device;
[0022] When the broadcast information includes the network connection information of the terminal device, it is determined whether the terminal device is normally connected to the network according to the network connection information.
[0023] In one embodiment, before the step of obtaining the first real-time data from the server, the method further includes:
[0024] Determine the IP protocol corresponding to the terminal device;
[0025] Determine the version corresponding to the IP protocol, and determine the target port of the server based on the version;
[0026] The step of obtaining first real-time data from the server includes:
[0027] A request is sent to a target port of the server to obtain first real-time data from the server through the target port.
[0028] In a second aspect, the present application further provides a data acquisition method, which is applied to a terminal device, wherein the terminal device includes a data acquisition device, and the data acquisition method includes:
[0029] When the terminal device accesses the network, broadcast network connection information;
[0030] Controlling the data acquisition device to receive broadcast network connection information;
[0031] The first real-time data output by the data acquisition device is acquired, wherein the data acquisition device acquires the first real-time data from the server when it is determined according to the network connection information that the terminal device is normally connected to the network.
[0032] In one embodiment, it further includes:
[0033] Register for a preset service, where the preset service is used for the data acquisition device to receive broadcast information and for the data acquisition device to continue to operate when the terminal device is normally connected to the network.
[0034] In one embodiment, it further includes:
[0035] When the terminal device is disconnected from the network, broadcast network disconnection information;
[0036] The data acquisition device is controlled to receive network disconnection information, wherein the data acquisition device stops running when receiving the network disconnection information.
[0037] In a third aspect, the present application further provides a data acquisition device, comprising:
[0038] A first acquisition module, used to acquire information broadcast by a terminal device;
[0039] A determination module, used to determine whether the terminal device is normally connected to the network according to the broadcast information;
[0040] The first acquisition module is also used to acquire first real-time data from the server when it is determined that the terminal device is normally connected to the network, and output the first real-time data to the terminal device.
[0041] In a fourth aspect, the present application further provides a data acquisition device, comprising: a memory and a processor;
[0042] Memory stores computer-executable instructions;
[0043] The processor executes the computer-executable instructions stored in the memory to perform the above data acquisition method.
[0044] In a fifth aspect, the present application further provides a terminal device, the terminal device comprising a data acquisition device, and the terminal device further comprising:
[0045] A broadcast module is used to broadcast network connection information when a terminal device accesses the network;
[0046] A control module, used for controlling the data acquisition device to receive broadcast network connection information;
[0047] The second acquisition module is used to acquire the first real-time data output by the data acquisition device, wherein the data acquisition device acquires the first real-time data from the server when it is determined according to the network connection information that the terminal device is normally connected to the network.
[0048] In a sixth aspect, the present application further provides a terminal device, including: a data acquisition device, a memory, and a processor;
[0049] The data acquisition device is used to acquire the first real-time data required by the terminal device from the server;
[0050] The memory stores computer-executable instructions;
[0051] The processor executes the computer-executable instructions stored in the memory to perform the data acquisition method as described above.
[0052] In a seventh aspect, the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and the computer execution instructions are used to implement the data acquisition method as described above when executed by a processor.
[0053] The data acquisition method, device, terminal device and computer-readable storage medium provided by the present application, the data acquisition device acquires the information broadcast by the terminal device, and when it is determined that the terminal device is normally connected to the network according to the broadcast information, acquires real-time data from the server, and outputs the real-time data to the terminal device. In the present application, the terminal device broadcasts when connected to the network, and can acquire real-time data from the data acquisition device. The acquisition of real-time data does not rely on manual operation, which improves the real-time performance and update efficiency of the terminal device for real-time data. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0055] Figure 1 A system architecture diagram for implementing the data acquisition method for this application;
[0056] Figure 2 This is a flow chart of the first embodiment of the data acquisition method of the present application;
[0057] Figure 3 This is a flow chart of the second embodiment of the data acquisition method of the present application;
[0058] Figure 4 This is a flow chart of the third embodiment of the data acquisition method of the present application;
[0059] Figure 5This is a flow chart of the fourth embodiment of the data acquisition method of the present application;
[0060] Figure 6 This is a flowchart of the fifth embodiment of the data acquisition method of this application.
[0061] Figure 7 This is a schematic diagram of the functional modules of the data acquisition device of this application;
[0062] Figure 8 This is a schematic diagram of the functional modules of the terminal device of this application;
[0063] Fig. 9 It is a structural diagram of a terminal device provided in an embodiment of the present application.
[0064] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0065] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0066] This application provides a data acquisition method, which can be Figure 1 The data acquisition device shown is implemented. The data acquisition device can be a physical device, a functional module or an application of the service registered by the terminal device. If the data acquisition device is a functional module or an application, the data acquisition device can be set in the terminal device. If the data acquisition device is a physical device, the data acquisition device is a device independent of the terminal device, and the data acquisition device is connected to the terminal device in communication.
[0067] like Figure 1 As shown, the data acquisition device 100 is connected to the terminal device 200 for communication. After the terminal device 200 is connected to the network, it broadcasts information. The data acquisition device 100 receives the broadcasted information, and after determining that the terminal device 200 is normally connected to the network based on the broadcasted information, it sends a data packet to the server 300, so that the server 300 feeds back real-time data to the data acquisition device 100 based on the data packet, and the data acquisition device 100 then sends the real-time data to the terminal device 200.
[0068] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0069] It should be noted that due to space limitations, this application specification does not exhaustively list all optional implementation methods. After reading this application specification, those skilled in the art should be able to think that as long as the technical features do not contradict each other, any combination of technical features can constitute an optional implementation method. The embodiments of this application are described in detail below.
[0070] Reference Figure 2 , Figure 2 In the first embodiment of the data acquisition method of the present application, the data acquisition method comprises the following steps:
[0071] Step S201, obtaining information broadcast by the terminal device.
[0072] In an embodiment, the execution subject is a data acquisition device. After the terminal device is connected to the network, it broadcasts information. The data acquisition device receives the information broadcast by the terminal device. The terminal device may be a device that is not provided with a SIM card, for example, the terminal device is a tablet or an office device with a large screen. When the terminal device is turned on, it connects to the network, and after connecting to the network, it broadcasts, and the broadcasted information includes information about the network connection.
[0073] Step S202: determine whether the terminal device is normally connected to the network based on the broadcast information.
[0074] After obtaining the broadcast information, the data acquisition device determines whether the terminal device is normally connected to the network based on the broadcast information.
[0075] Specifically, the data acquisition device acquires information about the network to which the terminal device is connected from the broadcast information, and determines whether the terminal device is normally connected to the network based on the network information, where the network information includes, for example, a network identifier, network quality parameters, and the like.
[0076] In one example, if the network identifier is in the blacklist, the data acquisition device can determine that the network accessed by the terminal device is unavailable, that is, the network accessed by the terminal device is abnormal. When the network identifier is not included in the blacklist, it can be determined that the terminal device is normally connected to the network.
[0077] In another example, if the network quality parameter is less than a preset network quality parameter, it can be determined that the network accessed by the terminal device is abnormal, and when the network quality parameter is greater than or equal to the preset network parameter, it is determined that the terminal device is normally accessing the network.
[0078] In another example, after connecting to the network, the terminal device sends information to the network to obtain a feedback result, and the feedback result is the response information from the network to the terminal device, or the feedback result is that the network does not feedback the response information to the terminal device. The information broadcast by the terminal device includes the feedback result. When the data acquisition device determines that the feedback result is the response information from the network to the terminal device, it can be determined that the terminal device is normally connected to the network; if the feedback result is that the network does not feedback the response information to the terminal device, it can be determined that the terminal device is abnormally connected to the network.
[0079] It should be noted that the terminal device and the data acquisition device are in a binding relationship, that is, the device identification of the terminal device is stored in the data acquisition device. After receiving the broadcast information, the data acquisition device obtains the device identification based on the broadcast information. If the obtained device identification is different from the stored device identification, the terminal device of the broadcast information is not the device bound to the data acquisition device, and the data acquisition device filters the information. If the obtained device identification is the same as the stored device identification, the data acquisition device determines whether the terminal device is normally connected to the network.
[0080] In addition, the data acquisition device determines whether the broadcast information includes the network connection information of the terminal device. If the broadcast information includes the network connection information of the terminal device, it determines whether the terminal is normally connected to the network according to the network connection information.
[0081] Step S203, when it is determined that the terminal device is normally connected to the network, first real-time data is obtained from the server, and the first real-time data is output to the terminal device.
[0082] When it is determined that the terminal device is normally connected to the network, the data acquisition device sends a request to the server to receive real-time data sent by the server. The real-time data is defined as first real-time data. The data acquisition device then outputs the first real-time data to the terminal device.
[0083] The IP protocol of the terminal device has multiple versions, and the server is also provided with a service port of the corresponding version. Exemplarily, there are two versions of the IP protocol, V4 and V6, and the server also has service ports of V4 and V6 versions. When the data obtains the first real-time data from the server, the IP protocol corresponding to the terminal device is determined, and the IP protocol used by the terminal device is also the IP protocol used by the data acquisition device; the data acquisition device determines the version corresponding to the IP protocol, and determines the target port of the server according to the version. For example, if the version of the IP protocol is V4, the target port is the service port of the V4 version. The data acquisition device then sends a request to the target port to obtain the first real-time data from the server through the target port.
[0084] The first real-time data may be the location, weather, time zone of the terminal device, icon style in the terminal device, language used, information of hotspots that the terminal device can connect to, information pushed to the terminal, etc. The server refers to a server in the Internet.
[0085] It should be noted that the broadcast receiving function of the data acquisition device is running in real time, but other functions are in a dormant state. After the broadcast receiving function receives the broadcast information, the data acquisition device activates the judgment function, and uses the judgment function to judge whether the terminal device is normally connected to the network. If it is determined that the terminal device is normally connected to the network, the data acquisition device activates all functions, thereby obtaining real-time data from the server in a scheduled or real-time manner. When the broadcast information received by the data acquisition device is network disconnection information, that is, it is determined that the terminal device is disconnected from the network, the data acquisition device only retains the broadcast receiving function and controls other functions to be in a dormant state.
[0086] In this embodiment, the data acquisition device acquires the information broadcast by the terminal device, and when it is determined that the terminal device is normally connected to the network according to the broadcast information, it acquires real-time data from the server and outputs the real-time data to the terminal device. In this embodiment, the terminal device broadcasts when connected to the network, and can acquire real-time data from the data acquisition device. The acquisition of real-time data does not rely on manual operation, which improves the real-time performance and update efficiency of the real-time data of the terminal device.
[0087] Reference Figure 3 , Figure 3 This is the second embodiment of the data acquisition method of this application. Based on the first embodiment, step S202 includes:
[0088] Step S301, obtaining network parameters of the network to which the terminal device accesses according to the broadcast information.
[0089] In this embodiment, it is necessary to determine the connectivity between the terminal device and the server.
[0090] The terminal device has its own network detection mechanism, so it uses the data acquisition device to determine whether the terminal device can communicate and connect with the server. The information that the terminal device can obtain through the specified URL using the wget command will contain some verification values and server status, etc. If the terminal device cannot obtain information through the wget command, it means that it cannot communicate with the server. If the information obtained by the terminal device through the wget command fails to pass the verification, or the server status does not meet the conditions, the terminal device cannot communicate with the server.
[0091] In this regard, when the terminal device broadcasts, it will broadcast the network parameters of the network to which the terminal device is connected, that is, the broadcast information includes the network parameters. After obtaining the broadcast information, the data acquisition device obtains the network parameters of the network to which the terminal device is connected from the broadcast information. The network parameters can be the URL (Uniform Resource Locator) of the server.
[0092] Step S302: Test the network based on preset commands and network parameters to obtain test results.
[0093] The data acquisition device can determine whether the terminal device has connectivity with the server through network parameters, that is, determine whether the terminal device is normally connected to the network. The data acquisition device can test the network parameters through preset commands. Exemplarily, the data acquisition device can test the network parameter URL through the wget command to obtain the test result, that is, download the file from the URL through the wget command.
[0094] Step S303: Determine whether the terminal device is normally connected to the network according to the test result.
[0095] After obtaining the test results, you can use the test results to determine whether the terminal device is normally connected to the network.
[0096] Exemplarily, if the information obtained by the terminal device from the server passes the verification, the test result is that the network is available. If the terminal device does not obtain information from the server, or the obtained information does not pass the verification, it can be determined that the network is unavailable, and it is also determined that the terminal device abnormally accesses the network.
[0097] In this embodiment, the data acquisition device acquires network parameters of the network accessed by the terminal device based on the broadcast information, and tests the network parameters based on the preset command to obtain the test results, thereby accurately determining whether the terminal device is normally connected to the network through the test results.
[0098] Reference Figure 4 , Figure 4 This is the third embodiment of the data acquisition method of this application. Based on the first embodiment or the second embodiment, step S203 includes:
[0099] Step S401, sending a first data packet to a server, the first data packet including a device identification of a terminal device, a preset check value and a command for obtaining first real-time data, the device identification and the preset check value are used by the server for communication verification.
[0100] In this embodiment, the data acquisition device sends a data packet to the server, and the data packet is defined as a first data packet. The first data packet can be a UDP (User Datagram Protocol) data packet, a TCP (Transmission Control Protocol) data packet, or an http data packet. If the first data packet is a UDP data packet, the defined protocol is added to the payload field in the first data packet, and a format of the first data packet is as follows:
[0101]
[0102] Another format of the first data packet is as follows:
[0103]
[0104] Among them, device ID is the unique identifier of each device; identity identifier: identifies whether the sender of the data packet is a device or a server; hash verification: a unique value generated during a communication process; public network address: stores the public network IP used by the terminal device; commands to be executed: stores the commands that the other end needs to execute; Json data: stores the return results of the command.
[0105] Based on the above format, the first data packet includes the device identification of the terminal device, the preset check value and the acquisition instruction of the first real-time data. The device identification is the device ID and the identity identification, the preset check value is the hash value, and the public network address is the network address of the terminal device to access the network. The device identification and the preset check value are used for communication verification by the server. The acquisition instruction is to fill in the field of the getjson identification, and the getjson identification is used to request the server to obtain real-time data.
[0106] Step S402, obtaining a second data packet sent by the server, and obtaining a field corresponding to a preset position in the second data packet.
[0107] Step S403, obtaining first real-time data from the field.
[0108] After obtaining the first data packet, the server parses the first data packet to obtain the device identification, the preset check value and the acquisition command, and verifies the communication through the device identification and the preset check value. If the verification is successful, the server executes the acquisition command to obtain the first real-time data, and fills the first real-time data into the field of the Josn data, that is, sends it to the data acquisition device in the form of a second data packet.
[0109] When receiving the second data packet, the data acquisition device acquires the field corresponding to the preset position in the second data packet, that is, acquires the field corresponding to the Josn data, thereby acquiring the first real-time data from the field.
[0110]
[0111] Exemplarily, the format of the data packet received from the server is as follows:
[0112]
[0113]
[0114] In this embodiment, the data acquisition device acquires real-time data from the server in the form of data packets.
[0115] Reference Figure 5 , Figure 5 This is the fourth embodiment of the data acquisition method of the present application, based on any one of the first to third embodiments, after step S203, further comprising:
[0116] Step S501, obtaining target parameters, where the target parameters include the current time point and / or the network address.
[0117] Step S502, when the target parameter meets the preset condition, obtain the second real-time data from the server, and output the second real-time data to the terminal device.
[0118] In this embodiment, the data acquisition device will update the real-time data of the terminal device. Specifically, the data acquisition device first acquires the target parameters, and the target parameters include the current time point and / or the network address.
[0119] In one example, when the target parameter is a network address, the data acquisition device sends a third data packet to the server. The format of the third data packet is the same as that of the first data packet, but the command to be executed in the third data packet is getIP, that is, the command to be executed is to request the server to obtain the network address used by the terminal device. After receiving the third data packet, the server fills the network address into the field of the public network address to obtain a fourth data packet, and the server then feeds the fourth data packet back to the data acquisition device. The data acquisition device parses the fourth data packet to obtain the field corresponding to the public network address, and then obtains the network address from the field.
[0120] After obtaining the target parameters, the data acquisition device determines whether the target parameters meet the preset conditions. If the target parameters meet the preset conditions, the second real-time data is obtained from the server and output to the terminal device to update the real-time data of the terminal device.
[0121] In one example, the interval duration for periodically acquiring real-time data can be set in the terminal device, and the terminal device sends the interval duration to the data acquisition device as a preset interval duration. The data acquisition device acquires the current time point and calculates the interval duration between the current time point and the time point when the real-time data was last acquired. If the interval duration reaches the preset duration, it is determined that the target parameter meets the preset condition, that is, the data acquisition device acquires the second real-time data from the server.
[0122] In another example, the data acquisition device stores the network address of the network to which the terminal device is connected. The data acquisition device acquires the network address from the server, compares the acquired network address with the stored network address to determine whether the network address used by the terminal device has changed. If it has changed, it is determined that the target parameter meets the preset condition, and the data acquisition device replaces the stored network address with the acquired network address, and acquires the second real-time data from the server.
[0123] It can be understood that satisfying the preset conditions includes at least one of the following: the interval between the current time point and the last time real-time data was obtained reaches the preset interval; the network address corresponding to the network accessed by the terminal device changes.
[0124] In this embodiment, the data acquisition device acquires the target parameter, and when the target parameter meets the preset condition, acquires the second real-time data from the server, thereby outputting the second real-time data to the terminal device, so that the terminal device updates the real-time data.
[0125] Reference Figure 6 , Figure 6 The fifth embodiment of the data acquisition method of the present application is applied to a terminal device. The data acquisition method includes:
[0126] Step S601, when the terminal device accesses the network, broadcast network connection information.
[0127] In this embodiment, the execution subject is a terminal device, which may be a device without a SIM card, for example, a tablet or an office device with a large screen. The terminal device is provided with a data acquisition device, which may be a functional module of the terminal device.
[0128] The terminal device registers a service, which is defined as a preset service. For example, the preset service is named cvt_auto_config, and the module corresponding to cvt_auto_config is the data acquisition device. The preset service will register the terminal's network broadcast receiver so that the data acquisition device can receive information broadcast by the terminal device. In addition, when the terminal device is connected to the network, the preset service is resident in the background of the terminal device, that is, the preset service is used for the data acquisition device to continue to run when the terminal device is normally connected to the network.
[0129] When a terminal device accesses a network, it broadcasts network connection information, including network parameters corresponding to the network.
[0130] Step S602: Control the data acquisition device to receive broadcast network connection information.
[0131] Step S603, obtaining first real-time data output by the data acquisition device, wherein the data acquisition device obtains the first real-time data from the server when determining, based on the network connection information, that the terminal device is normally connected to the network.
[0132] The terminal device controls the data acquisition device to receive the broadcast network connection information. The data acquisition device determines whether the terminal device is normally connected to the network based on the network connection information. When it is determined that the terminal device is normally connected to the network, the data acquisition device acquires the first real-time data from the server and outputs the first real-time data to the terminal device. The working process of the data acquisition device is specifically referred to the above description and will not be described again.
[0133] Furthermore, when the terminal device is disconnected from the network, network disconnection information is broadcasted, the terminal device controls the data acquisition device to receive the network disconnection information, and the data acquisition device stops running after receiving the network disconnection information.
[0134] Based on the above embodiments, application scenarios of the data acquisition method are described.
[0135] For example, when a terminal device is using the WiFi region code function, different WiFi channels are used in different regions. The WiFi channels are controlled according to the region code. The terminal device must strictly follow the WiFi channel standard of the region, otherwise there will be certain security risks. Some users do not care about the region code during use, which may result in users in region A still using the region code of region B. This embodiment can perfectly solve this problem. As long as the terminal device is turned on and connected to the Internet, the server can obtain information about the corresponding region. The region code can be automatically configured for the device through the region information to communicate and obtain real-time data. On the one hand, the user does not need to care about whether the region code is correct, and on the other hand, it can avoid the above security risks.
[0136] In this embodiment, the terminal device can configure common information such as real-time data in an automated manner. There is no need to manually set the common information of the terminal device. As long as the terminal device is connected to the network, the common information can be updated, which greatly increases the flexibility and timeliness of the functions within the terminal device. At the same time, it provides a more convenient way to maintain and add subsequent functions of the terminal device.
[0137] The present application also provides a data acquisition device, referring to Figure 7 , the data acquisition device 700 includes:
[0138] A first acquisition module 710 is used to acquire information broadcast by a terminal device;
[0139] A determination module 720 is used to determine whether the terminal device is normally connected to the network according to the broadcast information;
[0140] The first acquisition module 710 is used to acquire first real-time data from the server when it is determined that the terminal device is normally connected to the network, and output the first real-time data to the terminal device.
[0141] In one embodiment, the data acquisition device 700 includes:
[0142] A first acquisition module 710, configured to acquire network parameters of a network accessed by a terminal device according to broadcast information;
[0143] The test module is used to test the network based on preset commands and network parameters to obtain test results;
[0144] The determination module 720 is used to determine whether the terminal device is normally connected to the network according to the test result.
[0145] In one embodiment, the data acquisition device 700 includes:
[0146] A sending module, used to send a first data packet to a server, the first data packet including a device identification of a terminal device, a preset check value and a command for obtaining first real-time data, the device identification and the preset check value are used by the server for communication verification;
[0147] A first acquisition module 710 is used to acquire a second data packet sent by the server, and acquire a field corresponding to a preset position in the second data packet;
[0148] The first acquisition module 710 is used to acquire first real-time data from a field.
[0149] In one embodiment, the data acquisition device 700 includes:
[0150] A first acquisition module 710, configured to acquire target parameters, the target parameters including a current time point and / or a network address;
[0151] The first acquisition module 710 is used to obtain second real-time data from the server and output the second real-time data to the terminal device when the target parameter meets the preset conditions, wherein the interval between the current time point and the time point when the real-time data was last obtained reaches the preset interval, and / or the network address corresponding to the network accessed by the terminal device changes, and the target parameter meets the preset conditions.
[0152] In one embodiment, the data acquisition device 700 includes:
[0153] A determination module 720, configured to determine whether the broadcast information includes network connection information of the terminal device;
[0154] The determination module 720 is used to determine whether the terminal device is normally connected to the network according to the network connection information when the broadcast information includes the network connection information of the terminal device.
[0155] In one embodiment, the data acquisition device 700 includes:
[0156] A determination module 720 is used to determine the IP protocol corresponding to the terminal device;
[0157] The determination module 720 is used to determine the version corresponding to the IP protocol and determine the target port of the server according to the version;
[0158] The sending module is used to send a request to a target port of the server to obtain first real-time data from the server through the target port.
[0159] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0160] The present application also provides a terminal device, referring to Figure 8 , the terminal device 800 includes:
[0161] The broadcast module 810 is used to broadcast network connection information when the terminal device accesses the network;
[0162] The control module 820 is used to control the data acquisition device to receive the broadcast network connection information;
[0163] The second acquisition module 830 is used to acquire the first real-time data output by the data acquisition device, wherein the data acquisition device acquires the first real-time data from the server when it is determined according to the network connection information that the terminal device is normally connected to the network.
[0164] In one embodiment, the terminal device 800 includes:
[0165] The registration module is used to register a preset service, which is used for the data acquisition device to receive broadcast information and for the data acquisition device to continue to operate when the terminal device is normally connected to the network.
[0166] In one embodiment, the terminal device 800 includes:
[0167] The broadcast module 810 is used to broadcast network disconnection information when the terminal device is disconnected from the network;
[0168] The control module is used to control the data acquisition device to receive network disconnection information, wherein the data acquisition device stops running when receiving the network disconnection information.
[0169] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0170] The present application also provides a computer storage medium, which can store multiple instructions. The instructions are suitable for being loaded by a processor and executing the method steps of the above embodiment. The specific execution process can be seen in Figure 2-Figure 6 The specific description of the illustrated embodiment will not be repeated here.
[0171] The device where the storage medium is located may be a display device.
[0172] Fig. 9 The diagram is a schematic structural diagram of a terminal device according to an exemplary embodiment.
[0173] like Fig. 9 As shown, the terminal device 1000 may include: at least one processor 1001 , at least one network interface 1004 , a user interface 1003 , a memory 1005 , at least one communication bus 1002 and a data acquisition device 1006 .
[0174] The communication bus 1002 is used to realize the connection and communication between these components.
[0175] The user interface 1003 may include a display screen (Display) and a camera (Camera), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
[0176] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0177] Among them, the processor 1001 may include one or more processing cores. The processor 1001 uses various interfaces and lines to connect the various parts of the entire terminal device 1000, and executes various functions and processes data of the terminal device 1000 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1005, and calling data stored in the memory 1005. Optionally, the processor 1001 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 1001 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1001, and it can be implemented separately through a driver chip.
[0178] Among them, the memory 1005 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 1005 includes a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1005 may optionally be at least one storage device located away from the aforementioned processor 1001. As Fig. 9 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an operating application of a terminal device.
[0179] exist Fig. 9In the terminal device 1000 shown, the user interface 1003 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 1001 can be used to call the operating application of the terminal device stored in the memory 1005 to execute the various steps in the above embodiments.
[0180] It should be noted that Fig. 9 The structural diagram of the terminal device shown is also applicable to the data acquisition device.
[0181] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0182] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0183] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0184] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0185] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0186] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0187] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0188] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0189] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A data acquisition method, characterized in that: Applied to a data acquisition device, the data acquisition method comprises: Get the information broadcast by the terminal device; Determining whether the terminal device is normally connected to the network according to the broadcast information; When it is determined that the terminal device is normally connected to the network, first real-time data is obtained from a server, and the first real-time data is output to the terminal device.
2. The data acquisition method according to claim 1, characterized in that: The step of determining whether the terminal device has accessed the network normally according to the broadcast information comprises: Acquire network parameters of the network accessed by the terminal device according to the broadcast information; Testing the network based on the preset command and the network parameters to obtain a test result; Determine whether the terminal device is normally connected to the network according to the test result.
3. The data acquisition method according to claim 1, characterized in that: The step of obtaining first real-time data from the server comprises: Sending a first data packet to the server, the first data packet including a device identification of the terminal device, a preset check value, and a command for obtaining first real-time data, the device identification and the preset check value being used by the server for communication verification; Obtaining a second data packet sent by the server, and obtaining a field corresponding to a preset position in the second data packet; The first real-time data is acquired from the field.
4. The data acquisition method according to claim 1, characterized in that: After the step of outputting the first real-time data to the terminal device, the method further includes: Acquire target parameters, where the target parameters include a current time point and / or a network address; When the target parameter meets the preset conditions, second real-time data is obtained from the server and the second real-time data is output to the terminal device, wherein the interval between the current time point and the time point when the real-time data was last obtained reaches the preset interval, and / or the network address corresponding to the network accessed by the terminal device changes, and the target parameter meets the preset conditions.
5. The data acquisition method according to claim 1, characterized in that: The step of determining whether the terminal device has accessed the network normally according to the broadcast information comprises: Determining whether the broadcast information includes network connection information of the terminal device; When the broadcast information includes the network connection information of the terminal device, it is determined whether the terminal device is normally connected to the network according to the network connection information.
6. The data acquisition method according to any one of claims 1 to 5, characterized in that: Before the step of obtaining the first real-time data from the server, the method further includes: Determine the IP protocol corresponding to the terminal device; Determine the version corresponding to the IP protocol, and determine the target port of the server according to the version; The step of obtaining first real-time data from the server comprises: A request is sent to a target port of the server to obtain first real-time data from the server through the target port.
7. A data acquisition method, characterized in that: Applied to a terminal device, the terminal device includes a data acquisition device, and the data acquisition method includes: When the terminal device accesses the network, broadcasting network connection information; Controlling the data acquisition device to receive the broadcasted network connection information; Acquire the first real-time data output by the data acquisition device, wherein the data acquisition device acquires the first real-time data from the server when determining, according to the network connection information, that the terminal device is normally connected to the network.
8. The data acquisition method according to claim 7, characterized in that: Also includes: Registering a preset service, wherein the preset service is used for the data acquisition device to receive broadcast information and for the data acquisition device to continue to operate when the terminal device is normally connected to the network.
9. The data acquisition method according to claim 7 or 8, characterized in that: Also includes: When the terminal device is disconnected from the network, broadcasting network disconnection information; The data acquisition device is controlled to receive the network disconnection information, wherein the data acquisition device stops running when receiving the network disconnection information.
10. A data acquisition device, characterized in that: include: A first acquisition module, used to acquire information broadcast by a terminal device; A determination module, used to determine whether the terminal device is normally connected to the network according to the broadcast information; The first acquisition module is further configured to acquire first real-time data from a server when it is determined that the terminal device is normally connected to the network, and output the first real-time data to the terminal device.
11. A data acquisition device, characterized in that: include: Memory and processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to perform the data acquisition method according to any one of claims 1 to 6.
12. A terminal device, characterized in that: The terminal device includes a data acquisition device, and the terminal device also includes: A broadcast module is used to broadcast network connection information when a terminal device accesses the network; A control module, used for controlling the data acquisition device to receive the broadcasted network connection information; The second acquisition module is used to acquire the first real-time data output by the data acquisition device, wherein the data acquisition device acquires the first real-time data from the server when determining that the terminal device is normally connected to the network according to the network connection information.
13. A terminal device, characterized in that: include: Data acquisition device, memory and processor; The data acquisition device is used to acquire the first real-time data required by the terminal device from the server; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to perform the data acquisition method according to any one of claims 7 to 9.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the data acquisition method according to any one of claims 1 to 9.
