Data reporting methods, data reporting devices, electronic equipment and storage media

CN116489223BActive Publication Date: 2026-09-01SHENZHEN CLOU ELECTRONICS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310470949.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-24
Publication Date
2026-09-01
Estimated Expiration
2043-04-24

AI Technical Summary

Technical Problem

[0002]相关技术中,用电信息采集终端根据下发的数据上报任务上报数据,为确保上报的数据被主站成功接收,主站需要向用电信息采集终端回复一个确认帧,当用电信息采集终端接收到确认帧后,才能继续下一帧数据的上报,当用电信息采集终端未接收到确认帧,则一直等待接收确认帧直至等待超时,导致数据上报的效率大大降低

Benefits of technology

[0036]The data reporting method, device, electronic equipment, and computer-readable storage medium proposed in this application obtain configuration information for the data reporting task, including the task execution time, the data to be reported, and the confirmation waiting time. The data reporting task is executed according to the task execution time. If the waiting queue is not full, data is retrieved based on the data to be reported to obtain a first data reporting frame, which is then added to the waiting queue. This waiting queue allows multiple first data reporting frames to be stored at once, enabling the transmission of multiple frames to the master station instead of sending them frame by frame, thus improving the transmission efficiency. Furthermore, by obtaining the remaining storage space capacity of a preset communication transmission buffer and sending the first data reporting frame to the master station based on the remaining storage space capacity, the problem of incomplete data or data transmission failure caused by insufficient remaining storage space capacity can be solved. If no confirmation frame for the first data reporting frame is received from the master station within the waiting confirmation time, and the waiting reporting queue is not full, the second data reporting frame is obtained based on the data to be reported, and the second data reporting frame is sent to the master station. This makes full use of the time waiting for master station confirmation after reporting, and sends multiple data reporting frames in the waiting reporting queue to the master station, without having to wait indefinitely for the confirmation frame for the first data reporting frame before sending the second data reporting frame to the master station, thus improving the efficiency of data reporting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116489223B_ABST
    Figure CN116489223B_ABST
Patent Text Reader

Abstract

This application provides a data reporting method, data reporting device, electronic device, and storage medium, belonging to the field of communication technology, and applied to an electricity information collection terminal. The electricity information collection terminal includes a waiting reporting queue. The data reporting method includes: executing a data reporting task according to the task execution time; if the waiting reporting queue is not full, performing data retrieval based on the data to be reported to obtain a first data reporting frame, adding the first data reporting frame to the waiting reporting queue, obtaining the remaining storage space capacity of a preset communication sending buffer, and sending the first data reporting frame to the master station according to the remaining storage space capacity; if no confirmation frame of the first data reporting frame is received from the master station within the waiting confirmation time, and the waiting reporting queue is not full, obtaining a second data reporting frame based on the data to be reported, and sending the second data reporting frame to the master station, thereby improving the efficiency of data reporting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a data reporting method, a data reporting device, an electronic device, and a storage medium. Background Technology

[0002] In related technologies, electricity information collection terminals report data according to the assigned data reporting tasks. To ensure that the reported data is successfully received by the master station, the master station needs to reply with an acknowledgment frame to the electricity information collection terminal. Only after receiving the acknowledgment frame can the electricity information collection terminal continue reporting the next frame of data. If the electricity information collection terminal does not receive an acknowledgment frame, it will wait indefinitely until the waiting timeout occurs, resulting in a significant reduction in data reporting efficiency. Therefore, how to improve the efficiency of data reporting has become an urgent problem to be solved. Summary of the Invention

[0003] The main objective of this application is to provide a data reporting method, data reporting device, electronic device, and storage medium, which aim to improve the efficiency of data reporting.

[0004] To achieve the above objectives, a first aspect of this application proposes a data reporting method applied to an electricity consumption information collection terminal, wherein the electricity consumption information collection terminal includes a waiting queue for reporting, and the data reporting method includes:

[0005] Obtain the configuration information for the data reporting task; the configuration information includes the task execution time, the data to be reported, and the confirmation waiting time for the data reporting task.

[0006] The data reporting task is executed according to the task execution time.

[0007] If the waiting queue is not full, data retrieval is performed based on the data to be reported to obtain the first data reporting frame, and the first data reporting frame is added to the waiting queue.

[0008] Get the remaining storage space capacity of the preset communication sending buffer;

[0009] The first data reporting frame is sent to the main station according to the remaining storage space capacity;

[0010] If no confirmation frame for the first data reporting frame is received from the master station during the waiting confirmation time, and the waiting reporting queue is not full, then a second data reporting frame is obtained based on the data to be reported, and the second data reporting frame is sent to the master station.

[0011] In some embodiments, sending the first data reporting frame to the master station according to the remaining storage space capacity includes:

[0012] Obtain the data capacity of the first data reporting frame;

[0013] If the data capacity is less than or equal to the remaining storage space capacity, then the first data reporting frame is stored in the communication transmission buffer;

[0014] The first data reporting frame is read from the communication transmission buffer and sent to the master station.

[0015] In some embodiments, after obtaining the data capacity of the first data reporting frame, the data reporting method further includes:

[0016] If the data capacity is greater than the remaining storage space capacity, the first data reporting frame will not be sent to the main station.

[0017] In some embodiments, the configuration information further includes a retransmission count threshold, and after sending the first data reporting frame to the main station according to the remaining storage space capacity, the data reporting method further includes:

[0018] If no confirmation frame for the first data reporting frame is received from the master station during the waiting confirmation time, the first data reporting frame is resent to the master station, and the number of resentments is recorded.

[0019] If the number of retransmissions is greater than or equal to the retransmission threshold, the first data reporting frame is removed from the waiting reporting queue.

[0020] In some embodiments, after sending the first data reporting frame to the master station according to the remaining storage space capacity, the data reporting method further includes:

[0021] If an acknowledgment frame for the first data reporting frame is received from the master station during the waiting confirmation time, the first data reporting frame is removed from the waiting reporting queue.

[0022] In some embodiments, after adding the first data reporting frame to the waiting reporting queue, the data reporting method further includes:

[0023] Obtain the frame number of the first data reporting frame;

[0024] If the number of frames reaches the preset frame threshold or the waiting reporting queue is full, then exit the data retrieval process.

[0025] In some embodiments, after obtaining the frame number of the first data reporting frame, the data reporting method further includes:

[0026] If the number of frames does not reach the preset frame number threshold, data retrieval is performed again based on the data to be reported to obtain multiple first data reporting frames.

[0027] To achieve the above objectives, a second aspect of this application provides a data reporting device applied to an electricity consumption information collection terminal, wherein the electricity consumption information collection terminal includes a waiting queue for reporting, and the data reporting device includes:

[0028] The first acquisition module is used to acquire the configuration information of the data reporting task; the configuration information includes the task execution time, the data information to be reported, and the confirmation waiting time of the data reporting task.

[0029] The execution module is used to execute the data reporting task according to the task execution time;

[0030] The data retrieval module is used to retrieve data based on the data to be reported if the waiting reporting queue is not full, obtain a first data reporting frame, and add the first data reporting frame to the waiting reporting queue.

[0031] The second acquisition module is used to acquire the remaining storage space capacity of the preset communication sending buffer;

[0032] The first sending module is used to send the first data reporting frame to the main station according to the remaining storage space capacity;

[0033] The second sending module is configured to, if it does not receive an acknowledgment frame for the first data reporting frame returned by the master station during the waiting acknowledgment time, and the waiting reporting queue is not full, obtain a second data reporting frame based on the data to be reported information, and send the second data reporting frame to the master station.

[0034] To achieve the above objectives, a third aspect of the present application provides an electronic device, the electronic device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method described in the first aspect.

[0035] To achieve the above objectives, a fourth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect.

[0036] The data reporting method, device, electronic equipment, and computer-readable storage medium proposed in this application obtain configuration information for the data reporting task, including the task execution time, the data to be reported, and the confirmation waiting time. The data reporting task is executed according to the task execution time. If the waiting queue is not full, data is retrieved based on the data to be reported to obtain a first data reporting frame, which is then added to the waiting queue. This waiting queue allows multiple first data reporting frames to be stored at once, enabling the transmission of multiple frames to the master station instead of sending them frame by frame, thus improving the transmission efficiency. Furthermore, by obtaining the remaining storage space capacity of a preset communication transmission buffer and sending the first data reporting frame to the master station based on the remaining storage space capacity, the problem of incomplete data or data transmission failure caused by insufficient remaining storage space capacity can be solved. If no confirmation frame for the first data reporting frame is received from the master station within the waiting confirmation time, and the waiting reporting queue is not full, the second data reporting frame is obtained based on the data to be reported, and the second data reporting frame is sent to the master station. This makes full use of the time waiting for master station confirmation after reporting, and sends multiple data reporting frames in the waiting reporting queue to the master station, without having to wait indefinitely for the confirmation frame for the first data reporting frame before sending the second data reporting frame to the master station, thus improving the efficiency of data reporting. Attached Figure Description

[0037] Figure 1 This is a flowchart of the data reporting method provided in the embodiments of this application;

[0038] Figure 2 This is another flowchart of the data reporting method provided in the embodiments of this application;

[0039] Figure 3 yes Figure 1 The flowchart of step S150 in the middle;

[0040] Figure 4 This is another flowchart of the data reporting method provided in the embodiments of this application;

[0041] Figure 5 This is a schematic diagram of the structure of the data reporting device provided in the embodiments of this application;

[0042] Figure 6 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0044] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0046] In related technologies, electricity information collection terminals report data according to the assigned data reporting tasks. To ensure that the reported data is successfully received by the master station, the master station needs to reply with an acknowledgment frame to the electricity information collection terminal. Only after receiving the acknowledgment frame can the electricity information collection terminal continue reporting the next frame of data. If the electricity information collection terminal does not receive an acknowledgment frame, it will wait indefinitely until the waiting timeout occurs, resulting in a significant reduction in data reporting efficiency. Therefore, how to improve the efficiency of data reporting has become an urgent problem to be solved.

[0047] Based on this, embodiments of this application provide a data reporting method, a data reporting device, an electronic device, and a computer-readable storage medium, aiming to improve the efficiency of data reporting.

[0048] The data reporting method, data reporting device, electronic device, and computer-readable storage medium provided in this application are specifically described through the following embodiments. First, the data reporting method in this application is described.

[0049] The data reporting method provided in this application relates to the field of communication technology. The data reporting method provided in this application can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the data reporting method, but is not limited to the above forms.

[0050] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0051] Figure 1 This is an optional flowchart of the data reporting method provided in the embodiments of this application, applied to an electricity consumption information collection terminal, which includes a waiting queue for reporting. Figure 1 The method may include, but is not limited to, steps S110 to S160.

[0052] Step S110: Obtain the configuration information of the data reporting task; the configuration information includes the task execution time of the data reporting task, the data information to be reported, and the confirmation waiting time.

[0053] Step S120: Perform data reporting tasks based on task execution time;

[0054] Step S130: If the waiting queue is not full, perform data retrieval based on the data to be reported to obtain the first data reporting frame, and add the first data reporting frame to the waiting queue.

[0055] Step S140: Obtain the remaining storage space capacity of the preset communication sending buffer;

[0056] Step S150: Send the first data reporting frame to the main station according to the remaining storage space capacity;

[0057] Step S160: If no confirmation frame for the first data reporting frame is received from the master station within the waiting confirmation time, and the waiting reporting queue is not full, then the second data reporting frame is obtained according to the data to be reported, and the second data reporting frame is sent to the master station.

[0058] Steps S110 to S160, as illustrated in this embodiment, allow multiple first data reporting frames to be stored at once in a waiting reporting queue, enabling the transmission of multiple first data reporting frames to the master station instead of sending them frame by frame, thus improving the transmission efficiency of data reporting frames. Sending the first data reporting frames to the master station based on the remaining storage space capacity solves the problem of incomplete data or data transmission failure caused by insufficient remaining storage space. If no confirmation frame for the first data reporting frame is received from the master station within the waiting confirmation time, and the waiting reporting queue is not full, a second data reporting frame is obtained based on the data to be reported, and this second data reporting frame is sent to the master station. This fully utilizes the waiting time for master station confirmation after reporting, allowing multiple data reporting frames in the waiting reporting queue to be sent to the master station without continuously waiting for the confirmation frame of the first data reporting frame before sending the second data reporting frame, thereby improving the efficiency of data reporting.

[0059] In step S110 of some embodiments, the electricity consumption information acquisition terminal, referred to simply as the consumption terminal, is a device used by the power system to collect electricity consumption information. This electricity consumption information includes forward active energy readings, reverse active energy readings, voltage, current, and electricity purchase / consumption information. After the electricity consumption information acquisition terminal collects the electricity consumption information, it executes a data reporting task to report the electricity consumption information to the master station. The configuration information for the data reporting task is obtained. This configuration information includes the task execution time, the data information to be reported, and the confirmation waiting time. The task execution time can be a set time or a set time interval, used to execute the data reporting task at a set time or at regular intervals, sending the electricity consumption information collected by the consumption terminal to the master station. The data information to be reported is the set data content to be sent. The confirmation waiting time is the time the consumption terminal waits for the master station to return a confirmation frame.

[0060] In step S120 of some embodiments, the task execution time includes an execution time interval and an execution interval. Data reporting tasks are executed periodically according to the execution time interval and the execution interval. For example, the execution time interval is from 00:00:00 on January 1, 2022 to 00:00:00 on January 1, 2099, and the execution interval is 15 minutes. Within the execution time interval from 2022 to 2099, data reporting tasks are executed every 15 minutes. If the current time is not the task execution time, it is determined whether there is data to be sent in the waiting reporting queue. If there is data to be sent in the waiting reporting queue (i.e., the waiting reporting queue is not empty), the data is sent to the main station. It is understood that the waiting reporting queue is empty at the beginning of each cycle when the data reporting task is executed.

[0061] In step S130 of some embodiments, since the amount of data to be reported is large, the data to be reported is divided into multiple frames for reporting. The configuration information also includes queue capacity, which is used to indicate the maximum number of data reporting frames that the waiting reporting queue can hold. After the electricity information collection terminal collects the electricity information, it stores the electricity information in the database. When executing the data reporting task, if the waiting reporting queue is not full, it means that the number of data reporting frames in the current waiting reporting queue has not exceeded the queue capacity. Then, according to the data to be reported, the database of the collection terminal is searched to obtain the electricity information that the data reporting task needs to report. The electricity information is used as data, and a frame header and frame tail are added to form a complete reporting frame, resulting in the first data reporting frame. The first data reporting frame is then added to the waiting reporting queue. By opening a waiting reporting queue, multiple data reporting frames in the waiting reporting queue can be continuously sent to the main station during the time when the electricity information collection terminal is waiting for confirmation, thereby improving the efficiency of data reporting.

[0062] Please see Figure 2 In some embodiments, after step S130, the data reporting method may include, but is not limited to, steps S210 to S220:

[0063] Step S210: Obtain the frame number of the first data reporting frame;

[0064] In step S220, if the number of frames reaches the preset frame threshold or the waiting reporting queue is full, the data retrieval process is exited.

[0065] In step S210 of some embodiments, multiple data frames are reported in batches to obtain the frame number of the first data reporting frame.

[0066] In step S220 of some embodiments, a preset frame count threshold is used as the maximum number of first data reporting frames retrieved in the batch. If the number of frames reaches the preset frame count threshold, data retrieval is temporarily suspended, and these multiple first data reporting frames are reported as a batch. It should be noted that the queue capacity is multiples of the preset frame count threshold.

[0067] If the number of frames does not reach the preset frame threshold, data retrieval is performed again based on the data to be reported, resulting in multiple first data reporting frames. These first data reporting frames are then added to the waiting reporting queue. When the number of data reporting frames in the waiting reporting queue equals the queue capacity, the data retrieval process is exited.

[0068] At the start of each cycle, when the data reporting task begins, the waiting reporting queue is empty. If the preset frame count threshold is 5, the queue capacity is 50, and the number of data reporting frames retrieved in the current batch is 5, reaching the preset frame count threshold, then the data retrieval process exits, and the data reporting frames of the current batch in the waiting reporting queue are sent to the main station. If there are already 47 data reporting frames in the waiting reporting queue, and the first data reporting frame in the current batch has 3 frames, then the data retrieval process exits because the waiting reporting queue is full.

[0069] Through steps S210 to S220 above, if the terminal does not receive an acknowledgment frame for the current batch of data reporting frames, it directly enters the retrieval of the next batch of data reporting frames and sends the next batch of data reporting frames to the master station, without having to wait for the master station to return an acknowledgment frame. At the same time, it can report data in batches instead of reporting data frame by frame, which improves the efficiency of data reporting.

[0070] In step S140 of some embodiments, the communication method between the electricity information collection terminal and the master station is socket communication. The storage capacity of the communication sending buffer is fixed. If the master station does not receive the data reporting frames in time when sending multiple data reporting frames continuously, the communication sending buffer will quickly fill up, resulting in a data transmission anomaly. For example, only part of the data in the data reporting frame enters the communication sending buffer, while the remaining part does not, causing the master station to not receive the complete data reporting frame. When the communication sending buffer is full, continuing to send data reporting frames will result in data transmission failure, and the master station will not receive the data reporting frames. When a data transmission anomaly occurs, although the electricity information collection terminal has a retransmission mechanism, a certain timeout period is required before retransmission, which greatly reduces the efficiency of data reporting. This embodiment of the application detects the remaining storage capacity of the communication sending buffer through socket communication and sends data reporting frames according to the remaining storage capacity. This not only solves the data transmission anomaly problem but also improves the data reporting efficiency.

[0071] Please see Figure 3 In some embodiments, step S150 may include, but is not limited to, steps S310 to S330:

[0072] Step S310: Obtain the data capacity of the first data reporting frame;

[0073] Step S320: If the data capacity is less than or equal to the remaining storage space capacity, then the first data reporting frame is stored in the communication transmission buffer.

[0074] Step S330: Read the first data reporting frame from the communication transmission buffer and send the first data reporting frame to the master station.

[0075] In step S310 of some embodiments, the data capacity of the first data reporting frame is obtained, wherein the data capacity is used to represent the size of the storage space occupied by the first data reporting frame.

[0076] In step S320 of some embodiments, if the data capacity is less than or equal to the remaining storage space capacity of the communication transmission buffer, it indicates that the communication transmission buffer can store the first data reporting frame, and the electricity information collection terminal can send the complete first data reporting frame to the master station, avoiding incomplete data reporting frames received by the master station. If the data capacity is greater than the remaining storage space capacity of the communication transmission buffer, it indicates that the remaining storage space of the communication transmission buffer is insufficient to store the complete first data reporting frame, and the transmission of the first data reporting frame is stopped to avoid abnormal data transmission.

[0077] For example, if the communication buffer has a storage capacity of 10k and the data capacity of the data reporting frame is 1.5k, then the communication buffer can send a maximum of 6 data reporting frames continuously, which occupies 9k of storage space. The remaining storage space is 1k, which is insufficient to send a complete data reporting frame. Therefore, the transmission of the data reporting frame is stopped, and the first 6 data reporting frames are sent continuously.

[0078] In step S330 of some embodiments, a first data reporting frame is read from the communication transmission buffer and sent to the master station to complete the data reporting.

[0079] In steps S310 to S330 above, when the data capacity of the first data reporting frame is less than or equal to the remaining storage space capacity of the communication sending buffer, the first data reporting frame is sent. This ensures that the first data reporting frame is completely written into the communication sending buffer and avoids data transmission abnormalities caused by continuing to send data reporting frames when the communication sending buffer is full.

[0080] In some embodiments, continuously sending multiple data reporting frames can cause a surge in the load on the master station. Increasing the transmission time interval between data reporting frames can reduce the master station load. Specifically, the first transmission time of a given first data reporting frame is obtained, the current time is obtained, and the first transmission time is added to the transmission time interval to obtain the second transmission time. If the current time is greater than or equal to the second transmission time, another first data reporting frame is read from the communication transmission buffer and sent to the master station. If the current time is less than the second transmission time, the system continues to wait until another first data reporting frame can be sent.

[0081] Please see Figure 4 In some embodiments, after step S150, the data reporting method may also include, but is not limited to, steps S410 to S420:

[0082] Step S410: If no confirmation frame for the first data reporting frame is received from the master station within the waiting confirmation time, the first data reporting frame is resent to the master station, and the number of resentments is recorded.

[0083] Step S420: When the number of retransmissions is greater than or equal to the retransmission threshold, the first data reporting frame is removed from the waiting reporting queue.

[0084] In step S410 of some embodiments, after the electricity information collection terminal sends a first data reporting frame to the master station, the terminal waits for the master station to return an acknowledgment frame for the first data reporting frame. If no acknowledgment frame is received within the acknowledgment waiting time, it indicates that the acknowledgment waiting timeout has occurred, and the first data reporting frame needs to be resent. The terminal then resends the first data reporting frame to the master station according to the remaining storage space capacity, and records the number of resentments. The acknowledgment frame can be an ACK message. If an acknowledgment frame for the first data reporting frame is received from the master station within the acknowledgment waiting time, it indicates that the master station has successfully received the first data reporting frame or has completed data processing of the first data reporting frame. The terminal then deletes the first data reporting frame from the waiting reporting queue to release queue space, allowing for the retrieval of data reporting frames. The retrieved data reporting frames are added to the waiting reporting queue, and data reporting frames with data capacity less than or equal to the remaining storage space capacity are added to the communication transmission buffer and sent.

[0085] It should be noted that the confirmation waiting time can be a duration threshold. The confirmation time is recorded for the electricity information collection terminal to wait for the master station to return the confirmation frame of the first data reporting frame. If the confirmation time is greater than the duration threshold, it means that the electricity information collection terminal has timed out. If the confirmation time is less than or equal to the duration threshold, the electricity information collection terminal continues to wait for the master station to return the confirmation frame of the first data reporting frame until the confirmation waiting timeout occurs.

[0086] For example, if the confirmation waiting time is 10 seconds, and a confirmation frame for the first data reporting frame is received within 10 seconds, the first data reporting frame is deleted from the waiting reporting queue. If no confirmation frame for the first data reporting frame is received after 10 seconds, it means that the confirmation waiting time has expired and the first data reporting frame needs to be resent. If the number of resentments reaches the resentment limit and no confirmation frame is still received, the first data reporting frame is deleted from the waiting reporting queue.

[0087] In step S420 of some embodiments, if the number of retransmissions is greater than or equal to a retransmission count threshold, the first data reporting frame is removed from the waiting reporting queue. If the number of retransmissions is less than the retransmission count threshold, it indicates that the transmission of the first data reporting frame can continue, and the first data reporting frame is retransmitted to the master station according to the remaining storage space capacity.

[0088] In steps S410 to S420 above, if the confirmation timeout occurs, the first data reporting frame can be retransmitted to ensure that it is accurately and completely sent to the master station, thus guaranteeing data integrity. When the number of retransmissions reaches the retransmission threshold, the first data reporting frame is removed from the waiting reporting queue to free up storage space and ensure that more data reporting frames are sent to the master station, rather than continuously retransmitting the first data reporting frame.

[0089] In step S160 of some embodiments, if no acknowledgment frame for the first data reporting frame is received from the master station within the acknowledgment waiting time, and the waiting reporting queue is not full, a second data reporting frame is obtained based on the data to be reported, added to the waiting reporting queue, and sent to the master station according to the remaining storage space capacity. It should be noted that the sending method of the second data reporting frame is the same as that of the first data reporting frame, and will not be repeated here.

[0090] When the electricity information collection terminal does not receive the confirmation frame of the first data reporting frame returned by the master station, it sends the second data reporting frame during the waiting period for the confirmation, instead of waiting indefinitely for the confirmation frame of the first data reporting frame to be received before sending the next data reporting frame. This reduces the time wasted due to waiting and improves the data reporting efficiency.

[0091] The data reporting method of this application is illustrated below with a specific embodiment. The data reporting method includes:

[0092] Determine whether a data reporting task needs to be executed. If the result is yes, check whether the queue space of the waiting reporting queue is full. If the queue space is not full, retrieve the electricity consumption information that the data reporting task needs to report from the preset database, assemble the electricity consumption information into a data reporting frame, add the data reporting frame to the waiting reporting queue, and check whether the number of data reporting frames has reached the maximum number of reporting frames retrieved in this round. If the number of frames has not reached the maximum number, continue to retrieve new data reporting frames until the number of frames reaches the maximum number. If the number of frames reaches the maximum, the queue space is full, or the judgment result is negative, check if there are any reporting frames to be sent in the waiting reporting queue. The reporting frames to be sent include newly added data reporting frames in the waiting reporting queue and data reporting frames that have not reached the waiting acknowledgment timeout number. Socket communication buffer check is performed. When performing socket communication buffer check, if there is remaining storage space in the communication sending buffer, and the storage capacity of the remaining storage space is greater than or equal to the data capacity of the data reporting frame to be sent, then the reporting frame to be sent is sent, and the sending time, sending count, and other information are recorded. The system continues to check if there are any reporting frames to be sent in the waiting reporting queue, so that the reporting frame can be sent to the master station. If there are no reporting frames to be sent in the waiting reporting queue, or the communication sending buffer is full, or the storage capacity of the remaining storage space is less than the data capacity of each reporting frame to be sent, then the system continues to wait for the reception of acknowledgment frames. When an acknowledgment frame is received or the waiting acknowledgment timeout number is reached, the data reporting frame corresponding to the acknowledgment frame is removed from the waiting reporting queue.

[0093] By using socket communication to send buffer detection, the waiting time for the master station to reply and confirm after sending can be effectively utilized. This solves the problem of time-out retransmission caused by continuous sending of reporting frames leading to a full buffer and ineffective sending, and significantly improves the execution efficiency of proactive reporting tasks.

[0094] When electricity information collection terminals perform data reporting tasks, the execution time for these tasks is often limited to ensure data integrity. For example, if the data collection cycle is 15 minutes, the first 12 minutes are used to collect residential electricity information, and the 13th and 14th minutes are used for data reporting. This leaves only two minutes for reporting within the current cycle. If a mechanism of sending the next frame only after receiving confirmation from the master station is adopted, the time spent waiting for confirmation is wasted. If a method of continuously sending reporting frames with increased intervals is used, although it doesn't completely wait for confirmation frames, increasing the intervals still wastes time. It cannot be guaranteed that continuously sent frames will be completely written to the socket communication transmission buffer. If some frames are not successfully written to the socket communication transmission buffer and are mistakenly considered as sent, the master station will not receive the reporting frames and will not send confirmation frames. The terminal will then resend due to confirmation timeout, wasting time and significantly reducing the efficiency of the proactive reporting task.

[0095] The data reporting method in this application embodiment can enable the data acquisition terminal to continue sending reporting frames while waiting for confirmation from the master station, and solve the problem of sending failure due to full socket communication sending buffer, thereby greatly improving the execution efficiency of data reporting tasks (active reporting tasks).

[0096] Please see Figure 5 This application also provides a data reporting device applied to an electricity information collection terminal. The electricity information collection terminal includes a waiting queue for reporting and can implement the above-mentioned data reporting method. The device includes:

[0097] The first acquisition module 510 is used to acquire the configuration information of the data reporting task; the configuration information includes the task execution time of the data reporting task, the data information to be reported, and the confirmation waiting time.

[0098] Execution module 520 is used to perform data reporting tasks based on task execution time;

[0099] The data retrieval module 530 is used to retrieve data based on the data to be reported if the waiting queue is not full, obtain the first data reporting frame, and add the first data reporting frame to the waiting queue.

[0100] The second acquisition module 540 is used to acquire the remaining storage space capacity of the preset communication transmission buffer;

[0101] The first sending module 550 is used to send a first data reporting frame to the main station according to the remaining storage space capacity;

[0102] The second sending module 560 is used to obtain the second data reporting frame based on the data to be reported if it does not receive the confirmation frame of the first data reporting frame returned by the master station within the waiting confirmation time and the waiting reporting queue is not full, and then sends the second data reporting frame to the master station.

[0103] The specific implementation of this data reporting device is basically the same as the specific implementation of the data reporting method described above, and will not be repeated here.

[0104] Please see Figure 6 , Figure 6 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:

[0105] The processor 610 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.

[0106] The memory 620 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 620 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 620 and is called and executed by the processor 610 to execute the data reporting method of the embodiments of this application.

[0107] The input / output interface 630 is used to implement information input and output;

[0108] The communication interface 640 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0109] Bus 650 transmits information between various components of the device (e.g., processor 610, memory 620, input / output interface 630, and communication interface 640);

[0110] The processor 610, memory 620, input / output interface 630 and communication interface 640 are connected to each other within the device via bus 650.

[0111] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described data reporting method.

[0112] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0113] The data reporting method, data reporting device, electronic device, and computer-readable storage medium provided in this application embodiment can store multiple first data reporting frames at once through a waiting reporting queue, so as to send multiple first data reporting frames to the master station at the same time, instead of sending them frame by frame, thereby improving the sending efficiency of data reporting frames. Sending the first data reporting frames to the master station based on the remaining storage space capacity can solve the problem of incomplete data or data transmission failure caused by insufficient remaining storage space capacity. If no confirmation frame for the first data reporting frame is received from the master station within the waiting confirmation time, and the waiting reporting queue is not full, a second data reporting frame is obtained based on the data to be reported, and the second data reporting frame is sent to the master station. This fully utilizes the waiting time for master station confirmation after reporting, sending multiple data reporting frames in the waiting reporting queue to the master station, without having to wait indefinitely for the confirmation frame of the first data reporting frame before sending the second data reporting frame, thus improving the efficiency of data reporting.

[0114] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0115] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0116] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0117] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0118] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0119] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0120] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0121] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0122] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0123] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0124] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A data reporting method, characterized in that, An application is made in an electricity consumption information collection terminal, the electricity consumption information collection terminal including a waiting reporting queue, and the data reporting method including: Obtain the configuration information for the data reporting task; the configuration information includes the task execution time, the data to be reported, and the confirmation waiting time for the data reporting task. The data reporting task is executed according to the task execution time. If the waiting queue is not full, data retrieval is performed based on the data to be reported to obtain the first data reporting frame, and the first data reporting frame is added to the waiting queue. Get the remaining storage space capacity of the preset communication sending buffer; The first data reporting frame is sent to the main station according to the remaining storage space capacity; If no confirmation frame for the first data reporting frame is received from the master station during the waiting confirmation time, and the waiting reporting queue is not full, then a second data reporting frame is obtained based on the data to be reported information, and the second data reporting frame is sent to the master station. Sending the first data reporting frame to the main station according to the remaining storage space capacity includes: Obtain the data capacity of the first data reporting frame; if the data capacity is less than or equal to the remaining storage space capacity, store the first data reporting frame in the communication transmission buffer; read the first data reporting frame from the communication transmission buffer and send the first data reporting frame to the master station; If the data capacity is greater than the remaining storage space capacity, then the transmission of the first data reporting frame is stopped.

2. The data reporting method according to claim 1, characterized in that, The configuration information also includes a retransmission count threshold. After sending the first data reporting frame to the main station according to the remaining storage space capacity, the data reporting method further includes: If no confirmation frame for the first data reporting frame is received from the master station during the waiting confirmation time, the first data reporting frame is resent to the master station, and the number of resentments is recorded. If the number of retransmissions is greater than or equal to the retransmission threshold, the first data reporting frame is removed from the waiting reporting queue.

3. The data reporting method according to claim 1, characterized in that, After sending the first data reporting frame to the master station according to the remaining storage space capacity, the data reporting method further includes: If an acknowledgment frame for the first data reporting frame is received from the master station during the waiting confirmation time, the first data reporting frame is removed from the waiting reporting queue.

4. The data reporting method according to any one of claims 1 to 3, characterized in that, After adding the first data reporting frame to the waiting reporting queue, the data reporting method further includes: Obtain the frame number of the first data reporting frame; If the number of frames reaches the preset frame threshold or the waiting reporting queue is full, then exit the data retrieval process.

5. The data reporting method according to claim 4, characterized in that, After obtaining the frame number of the first data reporting frame, the data reporting method further includes: If the number of frames does not reach the preset frame number threshold, data retrieval is performed again based on the data to be reported to obtain multiple first data reporting frames.

6. A data reporting device, characterized in that, An application is made in an electricity consumption information collection terminal, the electricity consumption information collection terminal including a waiting reporting queue, and the data reporting device including: The first acquisition module is used to acquire the configuration information of the data reporting task; the configuration information includes the task execution time, the data information to be reported, and the confirmation waiting time of the data reporting task. The execution module is used to execute the data reporting task according to the task execution time; The data retrieval module is used to retrieve data based on the data to be reported if the waiting reporting queue is not full, obtain a first data reporting frame, and add the first data reporting frame to the waiting reporting queue. The second acquisition module is used to acquire the remaining storage space capacity of the preset communication sending buffer; The first sending module is used to send the first data reporting frame to the main station according to the remaining storage space capacity; The second sending module is used to obtain a second data reporting frame based on the data to be reported if no confirmation frame of the first data reporting frame returned by the master station is received during the waiting confirmation time and the waiting reporting queue is not full, and then send the second data reporting frame to the master station. Sending the first data reporting frame to the main station according to the remaining storage space capacity includes: Obtain the data capacity of the first data reporting frame; if the data capacity is less than or equal to the remaining storage space capacity, store the first data reporting frame in the communication transmission buffer; read the first data reporting frame from the communication transmission buffer and send the first data reporting frame to the master station; If the data capacity is greater than the remaining storage space capacity, then the transmission of the first data reporting frame is stopped.

7. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the data reporting method according to any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the data reporting method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Power business data coding transmission method and system, and storage medium

    CN112152697A

  • Retransmission Mechanism for Segmented Frames in Power Line Communication (PLC) Networks

    US20130343403A1