Method, device, processor and medium for realizing data collection and transmission processing
By setting up independent data collection and sending threads in wireless AP devices, designing network disconnection and data backup mechanisms, the data transmission integrity problems of wireless AP devices under signal instability and network disconnection are solved, and data reporting is carried out through data Policy files and module daemons improve the flexibility of data collection and sending and the stability of program operation.
Patent Information
- Application Number
- CN202210092274.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-26
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2042-01-26
AI Technical Summary
In the case of unstable signal and network disconnection, it is difficult for wireless AP devices to ensure the integrity of data transmission, and shutdown or restart of the device may destroy the integrity of data. At the same time, the existing technology is difficult to achieve the flexibility of data collection strategies and program operation. Robust.
By setting up data collection threads and data sending threads in wireless AP devices, timed data collection and transmission are independently carried out, and a network disconnection mechanism and data backup function are designed to ensure the integrity of the data in the case of network instability; at the same time, data is provided. Report policy files and module daemons to improve the flexibility of data collection and sending and the robustness of program operation.
Improves the robustness of data server connections of wireless AP devices in signal unstable scenarios, ensures the integrity of data transmission, and restores data transmission after the device is restarted through the data backup function, improving the flexibility and operation of information collection and sending modules stability.
Smart Images

Figure CN114501685B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of wireless communication terminals, and in particular to the field of information collection and transmission strategies, and specifically refers to a method, device, processor and computer-readable storage medium thereof for realizing information data collection and transmission processing based on a wireless AP. Background Art
[0002] The Internet is an indispensable tool for modern people's lives, and network access terminals play a vital role in it. In recent years, with the development of wireless network technology, network devices such as mobile phones and tablets have become increasingly dependent on wireless access terminals. Wireless access terminals, namely wireless APs, play an increasingly important role. Wireless APs in homes, shopping malls or enterprises serve as access points for various network devices and can record various behavioral information of themselves and access devices. With the development of the Internet of Things, various big data analysis service platforms continue to emerge, providing us with the possibility of establishing big data analysis. The combination of wireless APs and the Internet of Things data server platform can effectively collect various data of AP devices, making it possible for equipment manufacturers to analyze equipment data and user behavior, and provide support for manufacturers to improve equipment performance and service quality.
[0003] As a network access point, the wireless AP needs to collect device information including the device hardware information, device operation status, wifi signal, downstream device information, user behavior, etc. This information includes information that will not change for a long time, information that will change in a short time, and information that is triggered immediately, etc. Therefore, these information need to be classified into periodic reporting data and event-triggered data. The data collection and transmission module needs to meet the needs of these two types of data collection and transmission. In addition, due to the unstable signal of wireless devices, there is a frequent phenomenon of data disconnection. Data collection and transmission need to consider how to ensure the integrity of data transmission in the case of unstable network, and at the same time, whether the shutdown and restart of the device in this case will destroy the integrity of the data. In addition, in order to ensure the flexibility of the data collection strategy, parameters such as the period of data collection, thresholds, etc. can be changed, how to achieve parameter changes, and how to ensure the robustness of program operation. Summary of the invention
[0004] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a method, device, processor and computer-readable storage medium for realizing information data collection and transmission processing based on wireless AP, which has good flexibility, high quality and a wide range of applications.
[0005] In order to achieve the above-mentioned purpose, the method, device, processor and computer-readable storage medium thereof for realizing information data collection and transmission processing based on wireless AP of the present invention are as follows:
[0006] The method for realizing information data collection and transmission processing based on wireless AP has the following main features:
[0007] (1) Set up the certificate for connecting to the platform, parse the policy file, initialize parameters, and register messages;
[0008] (2) Set a timer;
[0009] (3) performing a data collection thread and a data sending thread at regular intervals, respectively, wherein the data collection thread and the data sending thread are performed independently and separately;
[0010] (4) If an exit message is received, the timer is canceled, the flag position of the data sending thread is set to false, and the exit step is completed;
[0011] The step of performing the data collection thread at a fixed time in step (3) is specifically as follows:
[0012] Start the data collection thread, collect system data regularly, receive trigger events, and collect data information of corresponding objects;
[0013] The step of timing the data sending thread in step (3) is specifically as follows:
[0014] Start the data sending thread and connect to the remote data server platform. If the connection fails, it will trigger the network disconnection and reconnection, and send the collected data to the remote data server platform.
[0015] Preferably, the step of regularly performing data collection thread in step (3) specifically includes the following processing procedures:
[0016] (a3.1) Trigger the timer;
[0017] (a3.2) Traverse the objects and decide whether to collect data based on the object type and timestamp;
[0018] (a3.3) Determine whether the data in the data collection and storage module exceeds the limit. If yes, clear the data in the data collection and storage module and continue with step (a3.4); otherwise, continue with step (a3.4);
[0019] (a3.4) Get object data and encapsulate it into json string format;
[0020] (a3.5) Insert the data header of the reported information into the json data object;
[0021] (a3.6) Insert the beginning and end of the json data into the tag, write it into the data collection and storage module, and end the object traversal.
[0022] Preferably, the step of timing the data sending thread in step (3) specifically includes the following processing procedures:
[0023] (b3.1) Start the data sending thread and set the remote data server platform connection interface parameters;
[0024] (b3.2) Connect to the remote data server terminal node and determine whether the connection is successful. If so, send the data in the data sending storage module to the terminal node, clear the data sending storage module, set the timer, and continue with step (b3.2); otherwise, continue with step (b3.3);
[0025] (b3.3) Start the reconnection mechanism and periodically retry the connection until the connection is successful, and then continue with step (b3.4);
[0026] (b3.4) Check the data sending storage module. If there is data in the data sending storage module and the size is not 0, report the content of the file and report the data; if there is no data in the data sending storage module, continue with step (b3.5);
[0027] (b3.5) Check whether there is data in the data collection and storage module. If so, proceed to step (b3.6); otherwise, remain in the waiting state. If data is found to exist in the data collection and storage module after the waiting time, proceed to step (b3.6); if the flag of the data sending thread is false, exit the step;
[0028] (b3.6) Read out the data from the data collection and storage module and write it into the data sending and storage module, clear the data from the data collection and storage module, send the data from the data sending and storage module, and clear the data from the data sending and storage module after successful sending.
[0029] Preferably, the step (b3.3) specifically comprises the following steps:
[0030] (b3.3.1) Set a short timer and reconnect multiple times. If a connection request is received during any reconnection, proceed to step (b3.4); otherwise, proceed to step (b3.3.2);
[0031] (b3.3.2) Set a long timer. If a connection request is received, continue with step (b3.4); otherwise, continue with step (b3.3.1) and reconnect in a loop until the connection is successful.
[0032] Preferably, the method further comprises the step of backing up data when the device is shut down or restarted, specifically comprising the following processing:
[0033] (1-1) Get the remaining space of the data partition and determine whether the remaining space of the partition can create a file. If yes, create restart information; otherwise, exit data backup;
[0034] (1-2) Obtain the data size of the data collection and storage module, and determine whether the collected data can be stored. If yes, back up the data of the data collection and storage module; otherwise, exit data backup;
[0035] (1-3) Obtain the data size of the data sending storage module and determine whether the sending data can be stored. If yes, back up the data sending storage module; otherwise, exit data backup;
[0036] (1-4) Determine whether the device information data can be stored. If so, back up the device information data; otherwise, exit data backup.
[0037] Preferably, the method further comprises a process guarding step, which specifically comprises the following processing procedures:
[0038] (2-1) Create a background daemon process;
[0039] (2-2) Regularly check the process running status. If it is detected that the process is not running, start the data collection thread or data sending thread.
[0040] Preferably, the method further comprises the step of checking the policy file, specifically:
[0041] Check the policy file regularly. If the server's policy file is updated, upgrade the policy file and restart the process to make the updated policy file take effect.
[0042] The main feature of the device for realizing information data collection and transmission processing based on wireless AP is that the device comprises:
[0043] a processor configured to execute computer executable instructions;
[0044] The memory stores one or more computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the method for collecting and sending information data based on the wireless AP are implemented.
[0045] The main feature of the processor for realizing information data collection and transmission processing based on wireless AP is that the processor is configured to execute computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the above-mentioned method for realizing information data collection and transmission processing based on wireless AP are realized.
[0046] The main feature of the computer-readable storage medium is that a computer program is stored thereon, and the computer program can be executed by a processor to implement the various steps of the above-mentioned method for realizing information data collection and transmission processing based on wireless AP.
[0047] The method, device, processor and computer-readable storage medium for realizing information data collection and transmission based on wireless AP of the present invention are adopted. Considering the problem of connecting to the server under the network with unstable wireless signal, a disconnection reconnection mechanism and data backup function are provided, which greatly improves the integrity of information data sent to the data server. The data reporting strategy file and module daemon improve the information collection flexibility and program operation robustness of the information collection and transmission module. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 The present invention is a schematic diagram of an independent data collection thread and a data transmission thread of the method for realizing information data collection and transmission processing based on a wireless AP.
[0049] Figure 2 The present invention is a flow chart of a method for realizing information data collection and transmission processing based on a wireless AP.
[0050] Figure 3 The data backup flow chart of the method for realizing information data collection and transmission processing based on wireless AP of the present invention. DETAILED DESCRIPTION
[0051] In order to more clearly describe the technical content of the present invention, further description is given below in conjunction with specific embodiments.
[0052] The method for collecting and sending information data based on wireless AP of the present invention comprises the following steps:
[0053] (1) Set up the certificate for connecting to the platform, parse the policy file, initialize parameters, and register messages;
[0054] (2) Set a timer;
[0055] (3) performing a data collection thread and a data sending thread at regular intervals, respectively, wherein the data collection thread and the data sending thread are performed independently and separately;
[0056] (4) If an exit message is received, the timer is canceled, the flag position of the data sending thread is set to false, and the exit step is completed;
[0057] The step of performing the data collection thread at a fixed time in step (3) is specifically as follows:
[0058] Start the data collection thread, collect system data regularly, receive trigger events, and collect data information of corresponding objects;
[0059] The step of timing the data sending thread in step (3) is specifically as follows:
[0060] Start the data sending thread and connect to the remote data server platform. If the connection fails, it will trigger the network disconnection and reconnection, and send the collected data to the remote data server platform.
[0061] As a preferred embodiment of the present invention, the step of regularly performing data collection thread in step (3) specifically includes the following processing procedures:
[0062] (a3.1) Trigger the timer;
[0063] (a3.2) Traverse the objects and decide whether to collect data based on the object type and timestamp;
[0064] (a3.3) Determine whether the data in the data collection and storage module exceeds the limit. If yes, clear the data in the data collection and storage module and continue with step (a3.4); otherwise, continue with step (a3.4);
[0065] (a3.4) Get object data and encapsulate it into json string format;
[0066] (a3.5) Insert the data header of the reported information into the json data object;
[0067] (a3.6) Insert the beginning and end of the json data into the tag, write it into the data collection and storage module, and end the object traversal.
[0068] As a preferred embodiment of the present invention, the step of timing the data sending thread in step (3) specifically includes the following processing procedures:
[0069] (b3.1) Start the data sending thread and set the remote data server platform connection interface parameters;
[0070] (b3.2) Connect to the remote data server terminal node and determine whether the connection is successful. If so, send the data in the data sending storage module to the terminal node, clear the data sending storage module, set the timer, and continue with step (b3.2); otherwise, continue with step (b3.3);
[0071] (b3.3) Start the reconnection mechanism and periodically retry the connection until the connection is successful, and then continue with step (b3.4);
[0072] (b3.4) Check the data sending storage module. If there is data in the data sending storage module and the size is not 0, report the content of the file and report the data; if there is no data in the data sending storage module, continue with step (b3.5);
[0073] (b3.5) Check whether there is data in the data collection and storage module. If so, proceed to step (b3.6); otherwise, remain in the waiting state. If data is found to exist in the data collection and storage module after the waiting time, proceed to step (b3.6); if the flag of the data sending thread is false, exit the step;
[0074] (b3.6) Read out the data from the data collection and storage module and write it into the data sending and storage module, clear the data from the data collection and storage module, send the data from the data sending and storage module, and clear the data from the data sending and storage module after successful sending.
[0075] As a preferred embodiment of the present invention, the step (b3.3) specifically comprises the following steps:
[0076] (b3.3.1) Set a short timer and reconnect multiple times. If a connection request is received during any reconnection, proceed to step (b3.4); otherwise, proceed to step (b3.3.2);
[0077] (b3.3.2) Set a long timer. If a connection request is received, continue with step (b3.4); otherwise, continue with step (b3.3.1) and reconnect in a loop until the connection is successful.
[0078] As a preferred embodiment of the present invention, the method further includes the step of backing up data when the device is shut down or restarted, specifically including the following processing:
[0079] (1-1) Get the remaining space of the data partition and determine whether the remaining space of the partition can create a file. If yes, create restart information; otherwise, exit data backup;
[0080] (1-2) Obtain the data size of the data collection and storage module, and determine whether the collected data can be stored. If yes, back up the data of the data collection and storage module; otherwise, exit data backup;
[0081] (1-3) Obtain the data size of the data sending storage module and determine whether the sending data can be stored. If yes, back up the data sending storage module; otherwise, exit data backup;
[0082] (1-4) Determine whether the device information data can be stored. If so, back up the device information data; otherwise, exit data backup.
[0083] As a preferred embodiment of the present invention, the method further includes a process guarding step, which specifically includes the following processing procedures:
[0084] (2-1) Create a background daemon process;
[0085] (2-2) Regularly check the process running status. If it is detected that the process is not running, start the data collection thread or data sending thread.
[0086] As a preferred embodiment of the present invention, the method further comprises the step of checking the policy file, specifically:
[0087] Check the policy file regularly. If the server's policy file is updated, upgrade the policy file and restart the process to make the updated policy file take effect.
[0088] The device for realizing information data collection and transmission processing based on wireless AP of the present invention comprises:
[0089] a processor configured to execute computer executable instructions;
[0090] The memory stores one or more computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the method for collecting and sending information data based on the wireless AP are implemented.
[0091] The processor of the present invention is used to realize information data collection and sending processing based on wireless AP, wherein the processor is configured to execute computer executable instructions, and when the computer executable instructions are executed by the processor, the various steps of the above-mentioned method for realizing information data collection and sending processing based on wireless AP are realized.
[0092] The computer-readable storage medium of the present invention stores a computer program thereon, and the computer program can be executed by a processor to implement the various steps of the above-mentioned method for collecting and sending information data based on a wireless AP.
[0093] In a specific embodiment of the present invention, a stable and effective information collection and transmission implementation scheme is provided for a wireless access terminal device. The scheme separates the collection of device information from data transmission to meet the collection and reporting of periodic data and triggered data of device information. The scheme designs a data transmission thread disconnection and reconnection mechanism so that the wireless AP device can ensure the robustness of the connection with the data server in the scenario of unstable wireless signal. The scheme provides a data backup function. When the network is not connected, the unsent data is saved in the system temporary directory. If the device has a normal shutdown or restart action, the system notifies the information collection and transmission module to save all the collected data that has not been sent to the flash. When the device is restarted, the information collection and transmission module first sends the data saved in the device to the data server, and then sends the newly collected data. The scheme also provides a data reporting strategy file and a module daemon. The strategy file defines the period value of periodic data and parameter thresholds of other data. The file is saved in the flash data backup partition and can be upgraded through the server. The daemon is responsible for maintaining the normal operation of the information collection and transmission module.
[0094] like Figure 1 As shown, the data collection and data transmission of the device information of the present invention are separated. The information collection and transmission module (RAE for short) creates independent collection threads and data transmission threads to separate data collection from data transmission. The data collection thread is responsible for collecting system data at regular intervals, receiving trigger events and collecting data information of corresponding objects. The data transmission thread is responsible for connecting to the remote data server cloud platform and sending the collected data to the platform.
[0095] The present invention separates the data collection and data transmission of device information to facilitate the collection and reporting of periodic data and triggered data of device information, thereby realizing a simple, flexible and highly adaptable data collection and transmission solution.
[0096] The present invention has a data transmission thread disconnection and reconnection mechanism. When data transmission fails, the connection status between the device and the server is checked. If the connection is disconnected, the data transmission thread initiates a reconnection request and triggers the disconnection and reconnection mechanism. The design of the data transmission thread disconnection and reconnection mechanism enables the wireless AP device to ensure the robustness of the connection with the data server in the scenario of unstable wireless signal.
[0097] like Figure 3 As shown, the present invention has a data backup strategy. When the network is not connected, the unsent data is saved in the system temporary directory. When the device is shut down or restarted normally, the system notifies the information collection and sending module to save all the unsent data to the flash. After the device is restarted, the information collection and sending module first sends the data saved in the device to the data server, and then sends the newly collected data.
[0098] The present invention has a modifiable data reporting strategy and provides a data reporting strategy file, which defines the period value of periodic data and the parameters and thresholds of event-triggered data, and the file is stored in the flash, and the parameters therein can be updated by upgrading the software server.
[0099] like Figure 2 As shown, the present invention provides a daemon for the information collection and sending module, which is responsible for the normal operation of the daemon module and the upgrade of the policy file. Figure 2 In the module, collect.data is the data collection and storage module, that is, the collection data file, which is used to store the system information data collected by the software from the device; publish.data is the data sending module, that is, the sending data file, which is used to temporarily store the data to be sent by the device; reporthead refers to the data header of the reported information; rebootinfo refers to the restart information.
[0100] The information collection and transmission strategy based on wireless AP of the present invention includes the following steps:
[0101] 1. Data Collection
[0102] 1. Design the CollectObj structure to represent the data collection object, define the collection object array gCollectObjs and initialize it.
[0103] 2. Set the timer for the information collection and sending module process and set the trigger interval to once every minute.
[0104] 3. After the timer is triggered, traverse the collection object array gCollectObjs and execute the func of each item to collect data according to the conditions.
[0105] i. The periodic object decides whether to collect data based on the result of comparing the current timestamp with (latastReportTime+intervalTime). If data is collected, after func is successfully executed, the latastReportTime of the object is set to the current timestamp. Among them, latastReportTime refers to the time of the most recent data report; intervalTime refers to the interval time of periodic data collection; isObjTiggered is the event object data collection trigger flag variable, indicating whether the object event is triggered; CollectObj refers to the data collection object entity.
[0106] ii. The trigger object decides whether to collect data based on the value of isObjTiggered. If data is collected, isObjTiggered is set to false after the collection is completed.
[0107] 4. When CollectObj of each object executes func, it encapsulates the data into json string format and passes it to the data aggregation function collectJsonObjData in the form of json object.
[0108] 5. The summary function obtains the basic information of the current device, encapsulates it in jsonObj format and inserts it into the current object as the information header.
[0109] 6. Open the data collection and storage module, write the string "BEGIN" as the starting mark of the json string object into the file, then write the content of the json object into the file, and finally write the string "END" into the file, and the object collection is completed.
[0110] 7. After all objects are written, the data collection process ends.
[0111] 2. Data transmission
[0112] 1. Create and start the report thread responsible for sending data.
[0113] 2. Connect to the remote data server platform. If the connection fails, retry periodically until the connection is successful.
[0114] 3. Check the data sending storage module publish.data. If there is data, send the data. After sending, clear the data in the data sending storage module publish.data.
[0115] 4. Check the data in the data collection and storage module collect.data. If there is data, copy the data to the data sending and storage module publish.data, and clear the data in the data collection and storage module collect.data.
[0116] 5. Send data: Send the data stored in the publish.data module. After sending, clear the data stored in the publish.data module.
[0117] 6. If the sending fails, retry to send the data 3 times. If the sending succeeds, wait 30 seconds and repeat step 3.
[0118] 7. If the sending fails after three retries, disconnect and return to step 2 to reconnect to the remote data server platform.
[0119] 3. Information Collection and Sending Module Program Operation Process
[0120] 1. Initialize parameter values, including ra_stage, various objects of the structure array gCollectObjs and their field values. Among them, ra_stage is the product form variable, and its possible values are dev (development stage), qa (testing stage), and prod (production stage); gCollectObjs refers to the collection object structure array; eventType is the event type variable, which identifies the event type of a certain event generated and is used to distinguish different events; timeStamp refers to the system event stamp.
[0121] 2. Parse the policy file policy.json, update the time interval set in the policy file policy.json to the gCollectObjs value, and the information collection and sending module process reports data according to the updated time interval. If the interval value of an object is 0, the time is not reported.
[0122] 3. Start the collection timer, set the timer to trigger once every minute, and traverse the gCollectObjs array.
[0123] i. For objects with eventType of fixed period, decide whether to collect data of a certain object based on the difference between the current system time and timeStamp and the interval value. If necessary, append the data to the data collection and storage module collect.data in json format.
[0124] ii. For objects whose eventType is event-triggered, initialize their timestamp timeStamp to 0 and set the trigger flag isObjTiggered to false. When an event occurs, modify isObjTiggered to true, collect its information to the data collection and storage module collect.data, and then set isObjTiggered to false.
[0125] 4. Start the report thread and set the remote data server platform connection interface parameters.
[0126] 5. Connect to the remote data server terminal node. If the connection is successful, send the data in the data sending storage module publish.data to the terminal node, then clear the data sending storage module publish.data, close the connection, set the timer, start the thread after 1 minute and return to step 4.
[0127] 6. If the connection is not successful, start the reconnection mechanism:
[0128] a. Set a one-minute timer. After the timer pops up, try connecting again
[0129] i. If the connection request is accepted, please execute the operation of publishing and sending logs
[0130] ii. If the request is rejected again, reset the one-minute timer
[0131] b. Repeat the above steps three (3) times. This will take 3 minutes.
[0132] c. If steps a and b fail, set a 1-hour timer and repeat steps a and b.
[0133] 7. After the connection is successful, check the data transmission storage module publish.data. If it exists and the size is not 0, report the content of the file. If there is no reported data, check whether there is data in the data collection storage module collect.data. If it exists, read the content of the file and write it to the data transmission storage module publish.data, clear the data collection storage module collect.data, send the data, and clear the data transmission storage module publish.data after the sending is successful.
[0134] 8. When the information collection and sending module process receives an event, it updates the data, resets the timer, and collects data for the triggered object.
[0135] 9. When the information collection and sending module receives the exit message, the timer is canceled, the flag of the main thread and the report thread is set to false, and the process exits.
[0136] 4. Data backup
[0137] like Figure 3 As shown in the figure, when the network is not connected, the collected data stored in the data collection storage module collect.data cannot be sent out; when the data is being sent, the network is disconnected, the data transmission will fail, and the data in the data transmission storage module publish.data will not be sent successfully. If the device is restarted during this period, these two files need to be backed up to prevent data loss.
[0138] When the system is about to restart or shut down the device:
[0139] 1. Get the data size of the data collection and storage module collect.data and the data sending and storage module publish.data
[0140] 2. Get the remaining space size of the flash data backup partition
[0141] 3. If there is enough remaining space, copy the data in the data collection storage module collect.data and the data in the data sending storage module publish.data to the flash.
[0142] 4. After the device is restarted, the information collection and sending module process connects to the remote data server and first sends the data backed up in the flash.
[0143] 5. Policy file upgrade and information collection and sending module process daemon
[0144] 1. Create a background daemon process.
[0145] 2. Regularly check the running status of the information collection and sending module process. If the information collection and sending module is not running, start the information collection and sending module process.
[0146] 3. Check the policy files regularly. If there are any updates to the policy files on the server, upgrade the policy files and then restart the information collection and sending module process to make the new policy files take effect.
[0147] The data object structure of the present invention is as follows:
[0148]
[0149] The specific implementation scheme of this embodiment can refer to the relevant description in the above embodiment, which will not be repeated here.
[0150] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0151] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.
[0152] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0153] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0154] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the corresponding program may be stored in a computer-readable storage medium, which, when executed, includes one of the steps of the method embodiment or a combination thereof.
[0155] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0156] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0157] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0158] The method, device, processor and computer-readable storage medium for realizing information data collection and transmission based on wireless AP of the present invention are adopted. Considering the problem of connecting to the server under the network with unstable wireless signal, a disconnection reconnection mechanism and data backup function are provided, which greatly improves the integrity of information data sent to the data server. The data reporting strategy file and module daemon improve the information collection flexibility and program operation robustness of the information collection and transmission module.
[0159] In this specification, the present invention has been described with reference to specific embodiments thereof. However, it is apparent that various modifications and variations may be made without departing from the spirit and scope of the present invention. Therefore, the specification and drawings should be regarded as illustrative rather than restrictive.
Claims
1. A method for collecting and sending information data based on wireless AP, characterized in that: The method comprises the following steps: (1) Set up the certificate for connecting to the platform, parse the policy file, initialize parameters, and register messages; (2) Set a timer; (3) performing a data collection thread and a data sending thread at regular intervals, respectively, wherein the data collection thread and the data sending thread are performed independently and separately; (4) If an exit message is received, the timer is canceled, the flag position of the data sending thread is set to false, and the exit step is completed; The step of performing the data collection thread at a fixed time in step (3) is specifically as follows: Start the data collection thread, collect system data regularly, receive trigger events, and collect data information of corresponding objects; The step of timing the data sending thread in step (3) is specifically as follows: Start the data sending thread, connect to the remote data server platform, if the connection fails, trigger the network disconnection and reconnection, and send the collected data to the remote data server platform; The step (3) of performing the data collection thread at a fixed time specifically includes the following processing procedures: (a3.1) Trigger the timer; (a3.2) Traverse the objects and decide whether to collect data based on the object type and timestamp; (a3.3) Determine whether the data in the data collection and storage module exceeds the limit. If yes, clear the data in the data collection and storage module and continue with step (a3.4); otherwise, continue with step (a3.4); (a3.4) Get object data and encapsulate it into json string format; (a3.5) Insert the data header of the reported information into the json data object; (a3.6) Insert the beginning and end of the json data into the tag, write it into the data collection and storage module, and end the object traversal.
2. The method for collecting and sending information data based on wireless AP according to claim 1, characterized in that: The step of timing the data sending thread in step (3) specifically includes the following processing procedures: (b3.1) Start the data sending thread and set the remote data server platform connection interface parameters; (b3.2) Connect to the remote data server terminal node and determine whether the connection is successful. If so, send the data in the data sending storage module to the terminal node, clear the data sending storage module, set the timer, and continue with step (b3.2); otherwise, continue with step (b3.3); (b3.3) Start the reconnection mechanism and periodically retry the connection until the connection is successful, and then continue with step (b3.4); (b3.4) Check the data sending storage module. If there is data in the data sending storage module and the size is not 0, report the content of the file and report the data; if there is no data in the data sending storage module, continue with step (b3.5); (b3.5) Check whether there is data in the data collection and storage module. If so, proceed to step (b3.6); otherwise, remain in the waiting state. If data is found to exist in the data collection and storage module after the waiting time, proceed to step (b3.6); if the flag of the data sending thread is false, exit the step; (b3.6) Read out the data from the data collection and storage module and write it into the data sending and storage module, clear the data collection and storage module, send the data from the data sending and storage module, and clear the data from the data sending and storage module after successful sending.
3. The method for collecting and sending information data based on wireless AP according to claim 2, characterized in that: The step (b3.3) specifically comprises the following steps: (b3.3.1) Set a short timer and reconnect multiple times. If a connection request is received during any reconnection, proceed to step (b3.4); otherwise, proceed to step (b3.3.2); (b3.3.2) Set a long timer. If a connection request is received, continue with step (b3.4); otherwise, continue with step (b3.3.1) and reconnect in a loop until the connection is successful.
4. The method for collecting and sending information data based on wireless AP according to claim 1, characterized in that: The method further includes the step of backing up data when the device is shut down or restarted, specifically including the following processing: (1-1) Get the remaining space of the data partition and determine whether the remaining space of the partition can create a file. If yes, create restart information; otherwise, exit data backup; (1-2) Obtain the data size of the data collection and storage module, and determine whether the collected data can be stored. If yes, back up the data of the data collection and storage module; otherwise, exit data backup; (1-3) Obtain the data size of the data sending storage module and determine whether the sending data can be stored. If yes, back up the data sending storage module; otherwise, exit data backup; (1-4) Determine whether the device information data can be stored. If so, back up the device information data; otherwise, exit data backup.
5. The method for collecting and sending information data based on wireless AP according to claim 1, characterized in that: The method further includes a process guarding step, which specifically includes the following processing procedures: (2-1) Create a background daemon process; (2-2) Regularly check the process running status. If it is detected that the process is not running, start the data collection thread or data sending thread.
6. The method for collecting and sending information data based on wireless AP according to claim 1, characterized in that: The method further comprises the step of checking the policy file, specifically: Check the policy file regularly. If the server's policy file is updated, upgrade the policy file and restart the process to make the updated policy file take effect.
7. A device for collecting and sending information data based on a wireless AP, characterized in that: The device comprises: a processor configured to execute computer executable instructions; The memory stores one or more computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the method for collecting and sending information data based on a wireless AP described in any one of claims 1 to 6 are implemented.
8. A processor for realizing information data collection and transmission processing based on wireless AP, characterized in that: The processor is configured to execute computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the method for collecting and sending information data based on a wireless AP described in any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program can be executed by a processor to implement the various steps of the method for collecting and sending information data based on a wireless AP as described in any one of claims 1 to 6.
