Data reporting method, electronic equipment and storage medium

By centrally reporting the latest data of the data change object in the electronic device at the end of the time window, the problems of communication link congestion and high cost caused by frequent data reporting are solved, and the frequency and cost of data reporting are reduced.

CN119835222APending Publication Date: 2025-04-15ECOFLOW INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410668854.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-27
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

In Internet information processing, electronic devices frequently report data when data changes, resulting in congestion and high cost of communication links.

Method used

By changing the data when the data change event is triggered, and reporting the latest data of the data change object that occurs in the time window at the end of the current time window, the number of data reports is reduced.

Benefits of technology

It effectively controls the frequency of data reporting, reduces the number of data reporting times and traffic, reduces the cost of data reporting, and avoids congestion in communication links.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119835222A_ABST
    Figure CN119835222A_ABST
Patent Text Reader

Abstract

The invention is applicable to the technical field of data processing, and provides a data reporting method, electronic equipment and a storage medium, and the method comprises the following steps: when a data change event is triggered, changing data of an object corresponding to the data change event; and when the ending moment of the current time window is reached, determining the object with data change in the current time window as a target object, and reporting the latest data of the target object. The data reporting cost can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data processing technology, and in particular relates to a data reporting method, an electronic device and a storage medium. Background Art

[0002] In Internet information processing, electronic devices usually need to report business data to specific network locations / devices such as cloud platforms so that users can find and extract business data.

[0003] Currently, when reporting data, every change in business data will trigger data reporting. Frequent data reporting is likely to cause congestion in the communication link, and the traffic cost of data reporting is high. Summary of the invention

[0004] The embodiments of the present application provide a data reporting method, an electronic device, and a storage medium, which can reduce the number of data reports and reduce the data reporting cost to a certain extent.

[0005] In a first aspect, an embodiment of the present application provides a data reporting method, including:

[0006] When a data change event is triggered, the data of the object corresponding to the data change event is changed;

[0007] When the end time of the current time window is reached, the object whose data has been changed in the current time window is determined as the target object, and the latest data of the target object is reported.

[0008] In a possible implementation manner of the first aspect, after reporting the latest data of the target object, the method further includes:

[0009] Open the next time window.

[0010] In a possible implementation manner of the first aspect, the method further includes:

[0011] When the end time of the current time window is reached and the target object is not found, the next time window is not opened.

[0012] In a possible implementation manner of the first aspect, after changing the data of the object corresponding to the data change event, the method further includes:

[0013] If there is no running time window, the latest data of the object corresponding to the data change event is reported and a new time window is opened.

[0014] In a possible implementation manner of the first aspect, if there is no running time window, reporting the latest data of the object corresponding to the data change event and opening a new time window includes:

[0015] If the time window timer is not running, the latest data of the object corresponding to the data change event is reported, and the time window timer is reset;

[0016] The time window timer is used to count the running time of the current time window, or to count down the remaining time until the end time of the current time window.

[0017] In a possible implementation manner of the first aspect, reporting the latest data of the target object includes:

[0018] The latest data of the target object is sent to the corresponding subscribers respectively.

[0019] In a possible implementation manner of the first aspect, the method further includes:

[0020] When a connection is established with a subscriber, the latest data of all objects subscribed by the subscriber are sent to the subscriber.

[0021] In a possible implementation manner of the first aspect, the key-value pair includes a key and a value corresponding to the key;

[0022] The step of determining the object whose data has been changed within the current time window as the target object and reporting the latest data of the target object includes:

[0023] A key whose value has changed within the current time window is determined as a target key, and the target key and the latest value of the target key are reported.

[0024] In a second aspect, an embodiment of the present application provides a data reporting device, including:

[0025] A data change module, used to change the data of the object corresponding to the data change event when a data change event is triggered;

[0026] The data reporting module is used to determine the object with data change in the current time window as the target object when the end time of the current time window is reached, and report the latest data of the target object.

[0027] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the data reporting method described in the first aspect when executing the computer program.

[0028] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data reporting method described in the first aspect are implemented.

[0029] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the data reporting method described in any one of the first aspects above.

[0030] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0031] In the embodiment of the present application, when a data change event is triggered, the data of the object corresponding to the data change event is changed in time. If there is a time window in operation, data reporting is not performed, but data reporting is performed when the end time of the current time window is reached. Since the object whose data changes in the current time window is determined as the target object when the data is reported, the data of the target object is reported at the arrival time of the current time window, and there is no need to report data every time the data of each object changes, therefore, the frequency of data reporting can be effectively controlled, the number of data reports can be reduced, and the situation of communication link congestion caused by frequent reporting can be avoided. Moreover, when reporting the target object, the intermediate data in the case of multiple data changes in the target object in the current time window is not concerned, and only the latest data of the target object is reported, which reduces the amount of data reported, effectively reduces the cost of data reporting and improves the efficiency of data reporting. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0033] Figure 1 This is a flow chart of a data reporting method provided by an embodiment of the present application;

[0034] Figure 2 It is a flowchart of a data reporting method provided by another embodiment of the present application;

[0035] Figure 3 It is a structural diagram of a data reporting device provided in an embodiment of the present application;

[0036] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0038] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0039] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0040] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.

[0041] Figure 1 A flow chart of a data reporting method provided in an embodiment of the present application is shown, which is described in detail as follows:

[0042] Step S101, when a data change event is triggered, the data of the object corresponding to the data change event is changed.

[0043] Optionally, the above data change events can be triggered by business changes, user interaction behaviors (such as modification, deletion or browsing, etc.), sensor data collection, environmental changes, operating condition changes or time-driven, and no specific restrictions are made here.

[0044] For example, when the electronic device is a server, that is, when the data reporting method is applied to the server, assuming that user A submits personal information modification on the client (such as user A clicks the Save button on the information modification page), the client sends a request B to the server (that is, the electronic device) to instruct the server to update the personal information, and the server receives the request B; because the request B indicates that the server needs to update the personal information of user A, when the server detects the request B, it triggers a data change event, and determines according to the request B that the object corresponding to the data change event is: user A's account, and then changes the personal information related to user A's account according to the information in the request B.

[0045] In the embodiment of the present application, when a data change event is triggered, the data of the object corresponding to the data change event is changed in a timely manner to ensure the real-time and accuracy of the data in the electronic device.

[0046] Step S102: When the end time of the current time window is reached, the object whose data has been changed in the current time window is determined as the target object, and the latest data of the target object is reported.

[0047] The above time window is used to indicate the time period for waiting for data reporting, and the end time of the above time window is used to indicate the timing of data reporting. In the embodiment of the present application, data is reported when the end time of the time window is reached. Optionally, in other embodiments, data can be reported at the beginning time of the time window or other times, which can be specifically set according to the actual application scenario.

[0048] During the operation of the electronic device, if there is a time window in operation, data reporting is performed when the end time of the current time window is reached. Since the data of one or more objects may change within the current time window, when reporting data, the object whose data has changed within the current time window is determined as the target object, and then the data of the target object is reported. It is not necessary to report data every time the data of each object changes, thereby avoiding situations such as communication link congestion caused by frequent reporting.

[0049] In order to reduce the amount of reported data, when reporting the data of the target object, only the latest data of the target object may be reported, and the latest data is the data corresponding to the end time of the target object at the current time window.

[0050] In some embodiments, in order to further reduce the cost of data reporting, before reporting the latest data of the target object, the latest data of the target object can be compared with the data of the target object at the beginning of the current time window (historical data). If the latest data is different from the historical data, the latest data of the target object is reported; if the latest data is the same as the historical data, it indicates that the target object may have undergone multiple data changes during the current time window, and after the last data change, its data is the same as the data before the first data change. At this time, the latest data of the target object may not be reported to reduce unnecessary data reporting.

[0051] For example, assuming that there is a time window currently, and its corresponding start time is t1; assuming that the data of object A changes at time t2, the data a1 corresponding to object A changes to a2, and a2 changes to a3 at time t4; and, assuming that the data of object B at time t1 is b1, at time t3 the data b1 changes to b2; then, when the end time t5 of the current time window is reached, the target objects that can be determined include object A and object B.

[0052] Since object A has undergone two data changes, before reporting the latest data a3 of object A, the latest data a3 of object A can be compared with the historical data a1; if the latest data a3 and the historical data a1 are different, the latest data a3 of object A is reported; if the latest data a3 and the historical data a1 are the same, the latest data a3 of object A is not reported.

[0053] Through the above processing, the frequency of data reporting is reduced, avoiding the need to frequently report data when data change events are frequently triggered. In addition, when the end of the current time window is reached, only the current data of the target object is reported, and the intermediate data when the target object undergoes multiple data changes within the current time window is not concerned, which reduces the amount of data reported, effectively reduces the cost of data reporting and improves data reporting efficiency.

[0054] In other embodiments, the latest data of all objects can be compared with the data of the object at the beginning of the current time window (historical data), and the objects whose latest data are different from the historical data can be determined as target objects, and then the latest data of the target objects are reported, thereby reducing unnecessary data reporting.

[0055] For example, suppose that there is a time window, and its corresponding start time is t1; suppose that object A has data changes at time t2, and the data a1 corresponding to object A is changed to a2, and a2 is changed to a1 at time t4, and suppose that the data of object B at time t1 is b1, and the data b1 is changed to b2 at time t3; then, when the end time t5 of the current time window is reached, the latest data of object A and object B are compared with the corresponding historical data respectively, and it can be determined that object A is not the target object, and object B is the target object. That is to say, although object A has data changes in the current time window, the latest data of object A is the same as the historical data, and there is no need to report it, so the latest data of object A is not reported, thereby reducing unnecessary data reporting.

[0056] In other embodiments, all objects that have undergone data changes within the current time window may be determined as target objects, and the latest data of the target objects may be directly reported.

[0057] For example, suppose there is a time window, and its corresponding start time is t1; suppose that the data of object A changes at time t2, and the data a1 corresponding to object A changes to a2, and a2 changes to a3 at time t4; and suppose that the data of object B at time t1 is b1, and the data b1 changes to b2 at time t3; then, when the end time t5 of the current time window is reached, the objects A and B whose data have changed within the current time window are determined as target objects, and no data comparison is performed, and the latest data a3 of object A and the latest data b2 of object B are directly reported.

[0058] In this embodiment, the data comparison process can be reduced, that is, the electronic device does not need to additionally store the data of all objects at the beginning of the current time window, which can reduce the occupation of the electronic device storage space.

[0059] Optionally, the time window can be determined based on the time interval between two adjacent data reports (such as 0.1 seconds, 0.5 seconds, 1 second, etc.). In some embodiments, the time interval can be set according to the real-time requirements of the actual application scenario. For example, in scenarios with high real-time requirements such as smart grids, the time interval can be set to 0.5 seconds, etc. By setting a shorter time window, the data reporting frequency and reporting cost can be reduced while taking into account the real-time requirements of the data.

[0060] In the embodiment of the present application, during the operation of the electronic device, when a data change event is triggered, the data of the object corresponding to the data change event is changed in time. If there is a time window in operation, the data is reported when the end time of the current time window is reached. Since the object whose data changes in the current time window is determined as the target object when the data is reported, the data of the target object is reported, and there is no need to report the data every time the data changes in each object. Therefore, the frequency of data reporting can be effectively controlled, thereby avoiding situations such as communication link congestion caused by frequent reporting. In addition, when reporting the data of the target object, only the latest data of the target object is reported, and the intermediate data of the target object in the case of multiple data changes in the current time window is not concerned, which reduces the amount of data reported, effectively reduces the cost of data reporting and improves the efficiency of data reporting.

[0061] In some embodiments, after reporting the latest data of the target object in the above step, the method further includes:

[0062] Open the next time window.

[0063] Since data changes are usually unpredictable, that is, it is usually impossible to determine whether data changes will occur in the future, therefore, in the embodiment of the present application, after reporting the latest data of the target object, the current time can be used as the starting time of the next time window, and the next time window can be opened to indicate the timing of the next data report through the next time window. That is, after a data report is made, the time of data reporting is used as the starting time of the next time window, and the next time window is opened to indicate that the timing of the next data report is at the end time of the next time window.

[0064] Through the above processing, it is ensured that after data reporting, the next data report will be made after a certain interval of time (i.e. the next time window), that is, the time of two adjacent data reports is guaranteed to meet the duration corresponding to the time window, avoiding situations such as communication link congestion caused by excessive data reporting frequency.

[0065] In some embodiments, the above method further comprises:

[0066] When the end time of the current time window is reached and the above target object is not found, the next time window is not opened.

[0067] Specifically, when the end time of the current time window is reached, if the target object is not found, that is, the data of each object in the current time window has not changed, no data reporting is required at the end time, and the next time window will not be opened.

[0068] It should be noted that, in the embodiment of the present application, the duration of the time window is determined according to the time interval between two adjacent data reports. When no data change occurs in the current time window, that is, no data is reported in the current time window, since the time interval between two adjacent data reports has been met when the end time of the current time window is reached, data reporting at any time after the end time of the current time window can meet the time interval limit between two adjacent data reports. At this time, the next time window may not be opened, that is, when a data change is detected, if there is no running time window, it indicates that no data reporting has been performed in the most recently running time window, and the current moment meets the opportunity for data reporting, and data reporting can be performed at any time.

[0069] In an embodiment of the present application, when the end moment of the current time window is reached, the time interval between two adjacent data reports has been met. Therefore, if no data change occurs to the object within the time window and there is no need to report data, the time interval between two adjacent data reports can be met at any time after the end moment of the current time window. At this time, the next time window may not be opened, that is, whether data reporting can be performed directly is directly indicated by whether there is a running time window, and there is no need to run the time window when it is not necessary, thereby reducing the occupied running resources.

[0070] In some embodiments, after the above step S101, the above method further includes:

[0071] If there is no running time window, the latest data of the object corresponding to the above data change event is reported and a new time window is opened.

[0072] In an embodiment of the present application, when there is no currently running time window, it indicates that the electronic device has not reported data in the most recently running time window and is in a relatively idle state, that is, the current moment meets the timing for data reporting. Therefore, when a data change event is triggered, if there is no currently running time window, then after changing the data of the object corresponding to the data change event, the latest data of the data change object can be reported immediately at the current moment.

[0073] In order to control the frequency of data reporting, after reporting the latest data of the data change object at the current moment, a new time window can be opened with the current moment as the starting moment of the new time window. At this time, the next data reporting time is at the arrival moment of the new time window, that is, when the arrival moment of the new time window is reached, it is determined whether the target object is found. If the target object is found, the latest data of the target is reported.

[0074] For example, suppose that the current time window corresponds to the time period from t1 to t5, where t1 is the start time and t5 is the end time; suppose that no data change occurs between t1 and t5, that is, when t5 is reached, the target object is not found, then the next time window will not be opened, and there will be no running time window after t5. Suppose that after t5, the electronic device detects that a data change occurs at t8, that is, the first data change after t5 occurs at t8. At this time, since the most recently running time window (running time: t1-t5) has not reported data, a new time window has not been run. Therefore, at t8, the latest data of the object with data change can be directly reported, and a new time window can be run with t8 as the start time.

[0075] It should be noted that in the embodiment of the present application, the electronic device will continue to detect whether the data change is triggered, that is, detect whether the data change occurs. Figure 2 As shown, when a triggering data change event is detected, the data of the object corresponding to the data change event is changed, and it is detected whether there is a running time window. If there is a running time window, when the end time of the current time window is reached, the object whose data has changed within the current time window is determined as the target object, and the latest data of the target object is reported; if there is no running time window, the latest data of the object corresponding to the current data change event can be directly reported, and then a new time window can be opened to ensure that the next data report is at the end time of the new time window.

[0076] In addition, when data changes occur, users are usually more sensitive to the reporting delay of the first data change. Therefore, in an embodiment of the present application, when changing the data corresponding to the data change object, if there is no running time window at present, that is, the electronic device has not reported data within a time window of the most recent operation, then the latest data of the object corresponding to the data change event is directly reported. This can improve the real-time perceived by users as much as possible while avoiding congestion of the communication link caused by frequent reporting.

[0077] At the same time, after reporting the latest data of the object corresponding to the data change event, a new time window is opened to ensure that the next data reporting timing is at the arrival time of the new time window to avoid the situation where the time interval between two adjacent data reports is too small.

[0078] In some embodiments, if there is no running time window, the latest data of the object corresponding to the data change event is reported and a new time window is opened, including:

[0079] If the time window timer is not running, the latest data of the object corresponding to the above data change event is reported, and the above time window timer is reset.

[0080] The time window timer is used to time the running time of the current time window, or to count down the remaining time to the end time of the current time window, that is, the time window timer indicates whether the end time of the current time window has been reached.

[0081] For example, assuming that the duration corresponding to a time window is 3 seconds, when the time window timer is used to time the running duration of the current time window, the time window timer starts timing from 0, and when the timing reaches 3 seconds, it indicates that the end time of the current time window has been reached, and the time window timer stops timing; when the time window timer is used to count down to the remaining duration of the end time of the current time window, assuming that the initial value of the time window timer is 3 seconds, and the current value of the time window timer is 0, it indicates that the end time of the current time window has been reached, and the time window timer stops counting down.

[0082] Since the time window timer is used to indicate whether the end time of the current time window has been reached, and when the time window timer is not running, it indicates that there is no running time window. Therefore, after triggering a data change event and changing the data of the object corresponding to the data change event, if the time window timer is not running at the current moment, the latest data of the object corresponding to the data change event can be directly reported.

[0083] When a new time window is opened based on the current moment, the time window timer can be directly reset to re-count the running time of the time window, or to re-count down the remaining time until the end moment of the time window.

[0084] In the embodiment of the present application, a simple time window timer is used to accurately represent the time of the current time window. When the time window timer reaches the corresponding moment, data reporting is automatically triggered (for example, a corresponding callback function is automatically triggered to trigger data reporting), which can achieve precise control of the time window, thereby improving the accuracy of data reporting.

[0085] In some embodiments, reporting the latest data of the target object includes:

[0086] The latest data of the above target objects are sent to the corresponding subscribers respectively.

[0087] The above-mentioned subscriber refers to a client that specifies an object of interest and waits to receive relevant information of the object of interest. It should be noted that the above-mentioned subscriber can be a hardware entity such as an IoT device, a server, a mobile phone, or a virtual carrier such as an application, an application program interface, or a service.

[0088] In some embodiments, different subscribers can subscribe to the same object. For example, different subscribers can subscribe to the same group of objects. When data changes occur in the group of objects, the target object is determined and the latest data of the target object is reported to all subscribers.

[0089] In other embodiments, since the objects of interest to different subscribers may be different, in order to reduce the cost of data reporting, when reporting the latest data of the target object, the latest data of the target object can be sent specifically to the subscribers who have subscribed to the target object, without reporting the data to other subscribers who have not subscribed to the target object, thereby reducing the traffic cost required for data reporting.

[0090] In some embodiments, different subscribers correspond to different communication links, and the maximum data packet lengths for data interaction between different links may be different. Therefore, in order to reduce the data processing required by the electronic device, when the number of subscribers (target subscribers) corresponding to the target object is greater than or equal to 2, that is, when the number of target links (communication links corresponding to the target subscribers) is greater than or equal to 2, the target data packet length can be determined based on the maximum data packet length of each target link, and then the latest data of the target object can be sub-packetized according to the target data packet length to obtain at least one data packet to be reported, and then the data packet to be reported is sent to the corresponding subscriber through each target link.

[0091] Through the above processing, the electronic device only needs to perform packet processing on the latest data of the target object once, and then send the corresponding data packet to be reported to each target subscriber through each target link respectively. Each target link no longer needs to perform packet processing based on its own maximum data packet length, which effectively reduces the data processing amount and data processing steps.

[0092] Optionally, when determining the target data packet length based on the maximum data packet length of each target link, the maximum data packet length with the smallest value can be determined as the target data packet length, so that each target link can better transmit the data packet to be reported obtained based on the target data packet length, and there is no need to perform multiple packet subpackaging processing for communication links with different maximum data packet lengths, effectively saving resources and improving the efficiency of data reporting.

[0093] For example, assuming that the subscribers corresponding to the target object include subscriber A, subscriber B and subscriber C, and the target links corresponding to each subscriber are target link a, target link b and target link c; assuming that the maximum data packet length of target link a is 120 bytes, the maximum data packet length of target link b is 130 bytes, and the maximum data packet length of target link c is 140 bytes, then the target maximum data packet length can be determined to be: 120 bytes; assuming that the size of the latest data of the target object is 200 bytes, based on the target maximum data packet length, it is processed into 2 data packets to be reported (data packet 1 and data packet 2), and then data packet 1 and data packet 2 are transmitted through the corresponding target links respectively, so that subscribers A, subscriber B and subscriber C can obtain the latest data of the target object.

[0094] In the embodiment of the present application, the latest data of the target object is sent only to the subscriber who subscribes to the target object, without sending it to other subscribers who are not interested in the target object. This can reduce the amount of data required to be reported and help reduce the traffic cost of data reporting.

[0095] In other embodiments, different links can perform data transmission according to their own set transmission parameters, that is, different links can perform packet processing and reporting on the latest data of the target object according to their own set maximum data packet lengths.

[0096] Usually in the process of data exchange, after sending a data packet, the data sender will wait for the data receiver to respond to ensure that the data receiver has received the sent data packet completely. For links with a long maximum data packet length, if the minimum value of each maximum data packet length is used for packet processing and reporting, the number of responses may increase, reducing the efficiency of data exchange.

[0097] For example, assuming that the subscribers corresponding to the target object include subscriber A, subscriber B and subscriber C, and the target links corresponding to each subscriber are: target link a, target link b and target link c; assuming that the maximum data packet length of target link a is 120 bytes, the maximum data packet length of target link b is 130 bytes, and the maximum data packet length of target link c is 240 bytes; assuming that the size of the latest data of the target object is 2400 bytes, for target link c, if it is packetized according to the maximum data packet length of 240 bytes of this link, it can be divided into 10 data packets. In the case of no packet loss, 10 data interactions can complete the data reporting; however, if the target link c is packetized according to the minimum value of the maximum data packet length (i.e., 120 bytes), it can be divided into 20 data packets. In the case of no packet loss, 20 data interactions are required to complete the data reporting, that is, the number of responses is doubled, which greatly affects the efficiency of data interaction.

[0098] In this embodiment, different links can perform packet processing and reporting on the latest data of the target object according to their respective set maximum data packet lengths, which can reduce the number of responses in some links and improve the efficiency of data interaction.

[0099] In some embodiments, some links may encounter communication failures such as timeout and packet loss during the process of reporting data. In this case, different links can retransmit according to independent maintenance data. The link encountering the communication failure can re-report the data packet with the communication failure according to the retransmission setting parameters corresponding to the link, such as the retransmission interval time, the maximum data packet length and other parameters, until the report is successful (for example, a response message of the successful reception of the data packet fed back by the subscriber is received).

[0100] This embodiment ensures that data packets are correctly synchronized and no redundant data packets are sent to irrelevant subscribers by independently maintaining data retransmission on each link, thereby effectively improving the efficiency of data retransmission.

[0101] In some embodiments, the above method further comprises:

[0102] When a connection is established with a subscriber, the latest data of all objects subscribed by the subscriber are sent to the subscriber.

[0103] In an embodiment of the present application, when a connection with a subscriber is successfully established, data of all objects subscribed by the subscriber at the current moment (i.e., the latest data) can be obtained and sent to the subscriber, so that the subscriber can obtain the latest data of all subscribed objects in a timely manner after subscription, thereby improving the user experience of the subscriber.

[0104] In some embodiments, when a connection is established with a subscriber, the latest data of all objects subscribed by the subscriber are sent to the subscriber, that is, the subscriber stores complete data of all subscribed objects. Therefore, after the connection with the subscriber is established, if data changes on the electronic device, only the latest data of the target object with data changes needs to be sent to the subscriber, and there is no need to send the latest data of all subscribed objects to the subscriber every time a data change occurs, which effectively reduces the amount of data reported.

[0105] In some embodiments, the electronic device may store data in a key-value pair, wherein the key-value pair includes a key and a value corresponding to the key.

[0106] Accordingly, the above-mentioned object whose data has changed within the current time window is determined as the target object, and the latest data of the target object is reported, including:

[0107] The key whose value has changed within the current time window is determined as the target key, and the target key and the latest value of the target key are reported.

[0108] When an electronic device uses a key-value pair to represent data, the key in the key-value pair can be understood as the above-mentioned object, and the value in the key-value pair can be understood as the data corresponding to the above-mentioned object.

[0109] Since the data of the object is represented in the form of a key-value pair, the smallest data unit is the key-value pair. Therefore, when determining the object with data changes, you can be specific to the key with data changes, that is, determine the key with data changes in the current time window as the target key, and then report the target key and the latest value of the target key, so that after the receiving end obtains the reported data, it can determine the object with data changes based on the target key, and then update the corresponding data based on the latest value of the target key.

[0110] In some embodiments, before reporting the target key and the latest value of the target key, the value of the target key at the last data report or at the beginning of the current time window can be determined as the historical value. Then, the historical value and the latest value are compared to see if they are the same. If the historical value and the latest value are different, the target key and the latest value of the target key are reported; if the historical value and the latest value are the same, the target key and the latest value of the target key are not reported.

[0111] In an embodiment of the present application, the data of each object is represented in the form of a key-value pair, and a set of data consisting of a key and a corresponding value is used as the definition of the communication protocol. As long as the keys do not conflict, the front-end and back-end compatibility of the communication can be well handled, thereby improving the compatibility and scalability of the communication protocol.

[0112] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0113] Corresponding to the data reporting method described in the above embodiment, Figure 3 A structural block diagram of a data reporting device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0114] Reference Figure 3 The device includes: a data change module 31 and a data reporting module 32. Among them,

[0115] The data change module 31 is used to change the data of the object corresponding to the data change event when the data change event is triggered;

[0116] The data reporting module 32 is used to determine the object with data change in the current time window as the target object when the end time of the current time window is reached, and report the latest data of the target object.

[0117] In the embodiment of the present application, during the operation of the electronic device, when a data change event is triggered, the data of the object corresponding to the data change event is changed in time. If there is a time window in operation, the data is reported when the end time of the current time window is reached. Since the object whose data changes in the current time window is determined as the target object when the data is reported, the data of the target object is reported, and there is no need to report the data every time the data changes in each object. Therefore, the frequency of data reporting can be effectively controlled, thereby avoiding situations such as communication link congestion caused by frequent reporting. In addition, when reporting the data of the target object, only the latest data of the target object is reported, and the intermediate data of the target object in the case of multiple data changes in the current time window is not concerned, which reduces the amount of data reported, effectively reduces the cost of data reporting and improves the efficiency of data reporting.

[0118] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0119] Figure 4 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 4 As shown, the electronic device 4 of this embodiment includes: at least one processor 40 ( Figure 4 Only one processor is shown in the figure), a memory 41, and a computer program 42 stored in the memory 41 and executable on the at least one processor 40, wherein the processor 40 implements the steps in any of the above-mentioned method embodiments when executing the computer program 42.

[0120] The electronic device 4 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device may include, but is not limited to, a processor 40 and a memory 41. Those skilled in the art will appreciate that Figure 4 It is only an example of the electronic device 4 and does not constitute a limitation on the electronic device 4. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0121] The processor 40 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0122] In some embodiments, the memory 41 may be an internal storage unit of the electronic device 4, such as a hard disk or memory of the electronic device 4. In other embodiments, the memory 41 may also be an external storage device of the electronic device 4, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 4. Further, the memory 41 may also include both an internal storage unit of the electronic device 4 and an external storage device. The memory 41 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program, etc. The memory 41 may also be used to temporarily store data that has been output or is to be output.

[0123] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0124] An embodiment of the present application also provides a network device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor implements the steps in any of the above-mentioned method embodiments when executing the computer program.

[0125] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0126] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0127] If the integrated unit is implemented in the form of 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 present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / electronic device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0128] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0129] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0130] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

[0132] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A data reporting method, characterized in that: Used in electronic equipment, including: When a data change event is triggered, the data of the object corresponding to the data change event is changed; When the end time of the current time window is reached, the object whose data has been changed in the current time window is determined as the target object, and the latest data of the target object is reported.

2. The method according to claim 1, characterized in that After reporting the latest data of the target object, the method further includes: Open the next time window.

3. The method according to claim 1, characterized in that The method further comprises: When the end time of the current time window is reached and the target object is not found, the next time window is not opened.

4. The method according to claim 1, characterized in that After changing the data of the object corresponding to the data change event, the method further includes: If there is no running time window, the latest data of the object corresponding to the data change event is reported and a new time window is opened.

5. The method according to claim 4, characterized in that If there is no running time window, the latest data of the object corresponding to the data change event is reported, and a new time window is opened, including: If the time window timer is not running, the latest data of the object corresponding to the data change event is reported, and the time window timer is reset; The time window timer is used to count the running time of the current time window, or to count down the remaining time until the end time of the current time window.

6. The method according to claim 1, characterized in that The reporting of the latest data of the target object includes: The latest data of the target object is sent to the corresponding subscribers respectively.

7. The method according to claim 6, characterized in that The method further comprises: When a connection is established with a subscriber, the latest data of all objects subscribed by the subscriber are sent to the subscriber.

8. The method according to claim 1, characterized in that A key-value pair includes a key and the value corresponding to the key; The step of determining the object whose data has been changed within the current time window as the target object and reporting the latest data of the target object includes: The key whose value has changed within the current time window is determined as the target key, and the target key and the latest value of the target key are reported.

9. An electronic device comprising a memory, one or more processors, and a computer program stored in the memory and executable on the one or more processors, characterized in that: When the one or more processors execute the computer program, the method according to any one of claims 1 to 8 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.