[go: up one dir, main page]

CN111556087B - Data transmission method, device, device and readable storage medium - Google Patents

Data transmission method, device, device and readable storage medium Download PDF

Info

Publication number
CN111556087B
CN111556087B CN202010152040.3A CN202010152040A CN111556087B CN 111556087 B CN111556087 B CN 111556087B CN 202010152040 A CN202010152040 A CN 202010152040A CN 111556087 B CN111556087 B CN 111556087B
Authority
CN
China
Prior art keywords
data
array
target
sending
collection point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN202010152040.3A
Other languages
Chinese (zh)
Other versions
CN111556087A (en
Inventor
张宏振
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Envision Innovation Intelligent Technology Co Ltd
Envision Digital International Pte Ltd
Original Assignee
Shanghai Envision Innovation Intelligent Technology Co Ltd
Envision Digital International Pte Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Envision Innovation Intelligent Technology Co Ltd, Envision Digital International Pte Ltd filed Critical Shanghai Envision Innovation Intelligent Technology Co Ltd
Priority to CN202010152040.3A priority Critical patent/CN111556087B/en
Publication of CN111556087A publication Critical patent/CN111556087A/en
Application granted granted Critical
Publication of CN111556087B publication Critical patent/CN111556087B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16YINFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
    • G16Y20/00Information sensed or collected by the things
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a data sending method, a data sending device, data sending equipment and a readable storage medium, and relates to the field of data transmission. The method comprises the following steps: acquiring target data generated by a target acquisition point; determining a data sending mode corresponding to a target acquisition point, wherein the data sending mode comprises at least one of a segmented sending mode and a timing sending mode, the segmented sending mode represents a mode of sending data by dividing a time slice, and the timing sending mode represents a mode of defining a dual-cycle array timer to send data; and uploading the target data to the cloud in a data sending mode. By setting a corresponding data sending mode to the target acquisition point and setting a segmented sending mode or a timed sending mode to the target acquisition point, the time complexity of data sending is reduced in a time slice mode, or the time complexity of data sending is reduced by a double-cycle array timer, the bandwidth pressure in the data sending process is relieved, and the data processing pressure of a cloud is relieved.

Description

数据发送方法、装置、设备及可读存储介质Data transmission method, device, device and readable storage medium

技术领域technical field

本申请实施例涉及数据传输领域,特别涉及一种数据发送方法、装置、设备及可读存储介质。The embodiments of the present application relate to the field of data transmission, and in particular, to a data sending method, device, device, and readable storage medium.

背景技术Background technique

随着物联网(Internet of Things,IoT)产业的发展,数据的生成速度逐步递增,而在IoT场景下,通常需要将采集得到的数据上传至云端进行进一步处理。With the development of the Internet of Things (IoT) industry, the speed of data generation is gradually increasing, and in IoT scenarios, it is usually necessary to upload the collected data to the cloud for further processing.

相关技术中,可以通过实时发送的方式将采集得到的数据上传至云端,实时发送是指当采集点采集得到数据后,直接将数据上传至云端的发送方式。In related technologies, the collected data can be uploaded to the cloud by means of real-time transmission. Real-time transmission means that after the data is collected by the collection point, the data is directly uploaded to the cloud.

然而,随着数据量的逐步增加,实时发送的方式对带宽和云端的数据处理造成了较大的压力,对带宽需求和云端的数据处理能力要求提升。However, with the gradual increase of the amount of data, the way of real-time sending puts great pressure on the bandwidth and data processing of the cloud, and the demand for bandwidth and the data processing capability of the cloud are increased.

发明内容Contents of the invention

本申请实施例提供了一种数据发送方法、装置、设备及可读存储介质,可以解决实时发送的方式对带宽和云端的数据处理造成了较大的压力的问题。所述技术方案如下:Embodiments of the present application provide a data sending method, device, device, and readable storage medium, which can solve the problem that the real-time sending method puts great pressure on bandwidth and cloud data processing. Described technical scheme is as follows:

一方面,提供了一种数据发送方法,所述方法包括:In one aspect, a method for sending data is provided, the method comprising:

获取目标采集点生成的目标数据,所述目标数据为待上传至云端的数据;Obtain the target data generated by the target collection point, the target data is data to be uploaded to the cloud;

确定与所述目标采集点对应的数据发送方式,所述数据发送方式中包括分段发送方式和定时发送方式中的至少一种,其中,所述分段发送方式表示划分时间片对数据进行发送的方式,所述定时发送方式表示定义双循环数组定时器对数据进行发送的方式;Determine the data transmission mode corresponding to the target collection point, the data transmission mode includes at least one of a segmented transmission mode and a timing transmission mode, wherein the segmented transmission mode means dividing time slices to send data The way of sending at regular intervals means the way of defining the double-cycle array timer to send data;

以所述数据发送方式将所述目标数据上传至所述云端。uploading the target data to the cloud in the data sending manner.

在一个可选的实施例中,所述数据发送方式包括所述分段发送方式;In an optional embodiment, the data sending method includes the segmented sending method;

所述以所述数据发送方式将所述目标数据上传至所述云端,包括:The uploading of the target data to the cloud in the data sending manner includes:

确定所述目标采集点的发送时间间隔以及当前时间点;Determine the sending time interval and the current time point of the target collection point;

结合所述当前时间点与所述发送时间间隔,确定所述目标采集点对应的目标时间片;Combining the current time point and the sending time interval, determine a target time slice corresponding to the target collection point;

在所述目标时间片将所述目标数据上传至所述云端。uploading the target data to the cloud in the target time slice.

在一个可选的实施例中,所述在所述目标时间片将所述目标数据上传至所述云端,包括:In an optional embodiment, uploading the target data to the cloud in the target time slice includes:

响应于所述目标时间片内未发送过数据,在所述目标时间片将所述目标数据上传至所述云端。Uploading the target data to the cloud in the target time slot in response to no data being sent within the target time slot.

在一个可选的实施例中,所述数据发送方式包括所述定时发送方式;In an optional embodiment, the data sending method includes the timing sending method;

所述以所述数据发送方式将所述目标数据上传至所述云端,包括:The uploading of the target data to the cloud in the data sending manner includes:

将所述目标采集点挂载至所述双循环数组定时器上,所述双循环数组定时器对应有游标指针;Mounting the target collection point on the double-cycle array timer, the double-cycle array timer corresponds to a cursor pointer;

响应于所述游标指针指向所述目标采集点所挂载的位置,将所述目标数据上传至所述云端。uploading the target data to the cloud in response to the cursor pointer pointing to the location where the target collection point is mounted.

在一个可选的实施例中,所述双循环数组定时器中包括第一定时数组和第二定时数组,所述第一定时数组以第一时间单位进行定时,所述第二定时数组以第二时间单位进行定时,所述第一时间单位的精度高于所述第二时间单位的精度,且所述第一定时数组的数组元素数量与所述第一时间单位的精度能够对应换算得到所述第二时间单位的精度;In an optional embodiment, the double-cycle array timer includes a first timing array and a second timing array, the first timing array is timed by the first time unit, and the second timing array is timed by the second time unit. Two time units are used for timing, the precision of the first time unit is higher than the precision of the second time unit, and the number of array elements of the first timing array and the precision of the first time unit can be converted correspondingly to obtain the the precision of the second time unit described;

所述将所述目标采集点挂载至所述双循环数组定时器上,所述双循环数组定时器对应有游标指针,包括:The said target collection point is mounted on the double loop array timer, and the double loop array timer corresponds to a cursor pointer, including:

响应于所述目标采集点的发送时间间隔小于所述第二时间单位的精度,将所述目标采集点挂载至所述第一定时数组上;In response to the sending time interval of the target collection point being less than the accuracy of the second time unit, mount the target collection point on the first timing array;

响应于所述发送时间间隔大于所述第二时间单位的精度,将所述目标采集点挂载至所述第二定时数组上。In response to the sending time interval being greater than the precision of the second time unit, the target collection point is mounted on the second timing array.

在一个可选的实施例中,所述方法,还包括:In an optional embodiment, the method further includes:

以所述发送时间间隔对所述目标采集点在所述双循环数组定时器上的挂载位置进行更新。The mounting position of the target collection point on the double-cycle array timer is updated at the sending time interval.

在一个可选的实施例中,所述目标采集点挂载在所述第一定时数组上;In an optional embodiment, the target collection point is mounted on the first timing array;

所述以所述发送时间间隔对所述目标采集点在所述双循环数组定时器上的挂载位置进行更新,包括:The updating of the mounting position of the target collection point on the double-cycle array timer at the sending time interval includes:

确定所述目标采集点在所述第一定时数组上当前挂载的第一位置点;determining the first position point currently mounted on the first timing array of the target collection point;

在所述第一定时数组中循环确定所述第一位置点移动与所述发送时间间隔对应长度后的第二位置点;In the first timing array, cyclically determine a second position point after the first position point has moved to a length corresponding to the sending time interval;

将所述目标采集点挂载至所述第二位置点。Mount the target collection point to the second location point.

在一个可选的实施例中,所述目标采集点挂载在所述第二定时数组上,所述游标指针包括第一指针和第二指针,所述第一指针与所述第一定时数组对应,所述第二指针与所述第二定时数组对应;In an optional embodiment, the target collection point is mounted on the second timing array, the cursor pointer includes a first pointer and a second pointer, and the first pointer and the first timing array Correspondingly, the second pointer corresponds to the second timing array;

所述响应于所述游标指针指向所述目标采集点所挂载的位置,将所述目标数据上传至所述云端,包括:The uploading the target data to the cloud in response to the cursor pointer pointing to the mounted position of the target collection point includes:

响应于所述第二指针指向所述目标采集点在所述第二定时数组上挂载的第三位置,结合所述发送时间间隔将所述目标采集点移动至所述第一定时数组的第四位置处;In response to the second pointer pointing to the third position of the target collection point mounted on the second timing array, moving the target collection point to the first timing array in combination with the sending time interval four positions;

响应于所述第一指针指向所述第一定时数组中的所述第四位置处,将所述目标数据上传至所述云端。Uploading the target data to the cloud in response to the first pointer pointing to the fourth position in the first timing array.

另一方面,提供了一种数据发送装置,该装置包括:In another aspect, a data sending device is provided, the device comprising:

获取模块,用于获取目标采集点生成的目标数据,所述目标数据为待上传至云端的数据;The obtaining module is used to obtain the target data generated by the target collection point, and the target data is data to be uploaded to the cloud;

确定模块,用于确定与所述目标采集点对应的数据发送方式,所述数据发送方式中包括分段发送方式和定时发送方式中的至少一种,其中,所述分段发送方式表示划分时间片对数据进行发送的方式,所述定时发送方式表示定义双循环数组定时器对数据进行发送的方式;A determining module, configured to determine a data transmission mode corresponding to the target collection point, the data transmission mode includes at least one of a segmented transmission mode and a timing transmission mode, wherein the segmented transmission mode represents dividing time The mode that slice sends data, and described regular transmission mode represents the mode that defines double cycle array timer to send data;

发送模块,用于以所述数据发送方式将所述目标数据上传至所述云端。A sending module, configured to upload the target data to the cloud in the data sending manner.

在一个可选的实施例中,所述数据发送方式包括所述分段发送方式;In an optional embodiment, the data sending method includes the segmented sending method;

所述确定模块,还用于确定所述目标采集点的发送时间间隔以及当前时间点;结合所述当前时间点与所述发送时间间隔,确定所述目标采集点对应的目标时间片;The determining module is further configured to determine the sending time interval and the current time point of the target collection point; combine the current time point and the sending time interval to determine the target time slice corresponding to the target collection point;

所述发送模块,还用于在所述目标时间片将所述目标数据上传至所述云端。The sending module is further configured to upload the target data to the cloud in the target time slice.

在一个可选的实施例中,所述确定模块,还用于响应于所述目标时间片内未发送过数据,在所述目标时间片将所述目标数据上传至所述云端。In an optional embodiment, the determining module is further configured to upload the target data to the cloud in the target time slot in response to no data being sent within the target time slot.

在一个可选的实施例中,所述数据发送方式包括所述定时发送方式;In an optional embodiment, the data sending method includes the timing sending method;

所述装置还包括:The device also includes:

挂载模块,用于将所述目标采集点挂载至所述双循环数组定时器上,所述双循环数组定时器对应有游标指针;A mounting module, configured to mount the target collection point on the double-cycle array timer, and the double-cycle array timer corresponds to a cursor pointer;

所述发送模块,还用于响应于所述游标指针指向所述目标采集点所挂载的位置,将所述目标数据上传至所述云端。The sending module is further configured to upload the target data to the cloud in response to the cursor pointing to the location where the target collection point is mounted.

在一个可选的实施例中,所述双循环数组定时器中包括第一定时数组和第二定时数组,所述第一定时数组以第一时间单位进行定时,所述第二定时数组以第二时间单位进行定时,所述第一时间单位的精度高于所述第二时间单位的精度,且所述第一定时数组的数组元素数量与所述第一时间单位的精度能够对应换算得到所述第二时间单位的精度;In an optional embodiment, the double-cycle array timer includes a first timing array and a second timing array, the first timing array is timed by the first time unit, and the second timing array is timed by the second time unit. Two time units are used for timing, the precision of the first time unit is higher than the precision of the second time unit, and the number of array elements of the first timing array and the precision of the first time unit can be converted correspondingly to obtain the the precision of the second time unit described;

所述挂载模块,还用于响应于所述目标采集点的发送时间间隔小于所述第二时间单位的精度,将所述目标采集点挂载至所述第一定时数组上;响应于所述发送时间间隔大于所述第二时间单位的精度,将所述目标采集点挂载至所述第二定时数组上。The mounting module is further configured to mount the target collection point on the first timing array in response to the sending time interval of the target collection point being less than the accuracy of the second time unit; in response to the The sending time interval is greater than the precision of the second time unit, and the target collection point is mounted on the second timing array.

在一个可选的实施例中,所述挂载模块,还用于以所述发送时间间隔对所述目标采集点在所述双循环数组定时器上的挂载位置进行更新。In an optional embodiment, the mounting module is further configured to update the mounting position of the target collection point on the double-cycle array timer at the sending time interval.

在一个可选的实施例中,所述目标采集点挂载在所述第一定时数组上;In an optional embodiment, the target collection point is mounted on the first timing array;

所述确定模块,还用于确定所述目标采集点在所述第一定时数组上当前挂载的第一位置点;在所述第一定时数组中循环确定所述第一位置点移动与所述发送时间间隔对应长度后的第二位置点;The determination module is also used to determine the first position point currently mounted on the first timing array of the target collection point; in the first timing array, cyclically determine the movement of the first position point and the The second position point after the corresponding length of the sending time interval;

所述挂载模块,还用于将所述目标采集点挂载至所述第二位置点。The mounting module is further configured to mount the target collection point to the second location point.

在一个可选的实施例中,所述目标采集点挂载在所述第二定时数组上,所述游标指针包括第一指针和第二指针,所述第一指针与所述第一定时数组对应,所述第二指针与所述第二定时数组对应;In an optional embodiment, the target collection point is mounted on the second timing array, the cursor pointer includes a first pointer and a second pointer, and the first pointer and the first timing array Correspondingly, the second pointer corresponds to the second timing array;

所述挂载模块,还用于响应于所述第二指针指向所述目标采集点在所述第二定时数组上挂载的第三位置,结合所述发送时间间隔将所述目标采集点移动至所述第一定时数组的第四位置处;The mounting module is further configured to move the target collection point in combination with the sending time interval in response to the second pointer pointing to a third position where the target collection point is mounted on the second timing array to the fourth position of the first timing array;

所述发送模块,还用于响应于所述第一指针指向所述第一定时数组中的所述第四位置处,将所述目标数据上传至所述云端。The sending module is further configured to upload the target data to the cloud in response to the first pointer pointing to the fourth position in the first timing array.

另一方面,提供了一种计算机设备,所述计算机设备包括处理器和存储器,所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如上述本申请实施例中任一所述的数据发送方法。In another aspect, a computer device is provided, the computer device includes a processor and a memory, at least one instruction, at least one program, code set or instruction set are stored in the memory, the at least one instruction, the at least A program, the code set or instruction set is loaded and executed by the processor to implement the data sending method described in any one of the above embodiments of the present application.

另一方面,提供了一种计算机可读存储介质,所述存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如上述本申请实施例中任一所述的数据发送方法。In another aspect, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set or instruction set are stored in the storage medium, the at least one instruction, the at least one program, the code The set or instruction set is loaded and executed by the processor to implement the data sending method described in any one of the above-mentioned embodiments of the present application.

另一方面,提供了一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得计算机执行如上述本申请实施例中任一所述的数据发送方法。In another aspect, a computer program product is provided. When the computer program product is run on a computer, the computer is made to execute the data sending method described in any one of the foregoing embodiments of the present application.

本申请实施例提供的技术方案带来的有益效果至少包括:The beneficial effects brought by the technical solutions provided by the embodiments of the present application at least include:

通过向目标采集点设置对应的数据发送方式,并向目标采集点设置分段发送方式或定时发送方式,从而以时间片的形式降低数据发送的时间复杂度,或以双循环数组定时器降低数据发送的时间复杂度,减缓数据发送过程中的带宽压力,以及减缓云端的数据处理压力,提高了数据的发送处理效率。By setting the corresponding data sending method to the target collection point, and setting the segmented sending method or timing sending method to the target collecting point, the time complexity of data sending can be reduced in the form of time slices, or the data can be reduced with a double-cycle array timer The time complexity of sending reduces the bandwidth pressure during data sending and the data processing pressure on the cloud, improving the efficiency of data sending and processing.

附图说明Description of drawings

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained based on these drawings without creative effort.

图1是本申请一个示例性的实施例提供的数据发送方法的实施环境示意图;FIG. 1 is a schematic diagram of an implementation environment of a data sending method provided by an exemplary embodiment of the present application;

图2是本申请一个示例性实施例提供的数据发送方法的流程图;FIG. 2 is a flowchart of a data sending method provided by an exemplary embodiment of the present application;

图3是本申请另一个示例性实施例提供的数据发送方法的流程图;FIG. 3 is a flowchart of a data sending method provided by another exemplary embodiment of the present application;

图4是基于图3示出的实施例提供的分段发送方式的示意图;FIG. 4 is a schematic diagram of a segmented transmission method provided based on the embodiment shown in FIG. 3;

图5是基于图3示出的实施例提供的另一个示例性分段发送方式的示意图;Fig. 5 is a schematic diagram of another exemplary segmented transmission method provided based on the embodiment shown in Fig. 3;

图6是本申请另一个示例性实施例提供的数据发送方法的流程图;FIG. 6 is a flowchart of a data sending method provided by another exemplary embodiment of the present application;

图7是基于图6示出的实施例提供的双循环数组定时器的示意图;FIG. 7 is a schematic diagram of a double-cycle array timer provided based on the embodiment shown in FIG. 6;

图8是基于图6示出的实施例提供的另一个示例性双循环数组定时器的示意图;FIG. 8 is a schematic diagram of another exemplary double-cycle array timer provided based on the embodiment shown in FIG. 6;

图9是本申请一个示例性实施例提供的数据发送装置的结构框图;Fig. 9 is a structural block diagram of a data sending device provided by an exemplary embodiment of the present application;

图10是本申请另一个示例性实施例提供的数据发送装置的结构框图;FIG. 10 is a structural block diagram of a data sending device provided in another exemplary embodiment of the present application;

图11是本申请一个示例性的实施例提供的服务器的结构框图。Fig. 11 is a structural block diagram of a server provided by an exemplary embodiment of the present application.

具体实施方式Detailed ways

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the purpose, technical solution and advantages of the present application clearer, the implementation manners of the present application will be further described in detail below in conjunction with the accompanying drawings.

首先,对本申请实施例中涉及的名词进行简单介绍:First, a brief introduction to the nouns involved in the embodiments of this application:

实时发送:是指当采集点生成的数据实时发送至云端的发送方式,也即当采集点生成待上传的数据时,直接进数据上传至云端进行进一步处理。然而,实时发送方式会对带宽以及云端数据处理造成较大的压力,对发送过程中的带宽要求较高,对云端数据处理能力的要求也较高。Real-time sending: refers to the sending method when the data generated by the collection point is sent to the cloud in real time, that is, when the data to be uploaded is generated by the collection point, the data is directly uploaded to the cloud for further processing. However, the real-time sending method will put a greater pressure on the bandwidth and cloud data processing, and has higher requirements on the bandwidth during the sending process, as well as higher requirements on the cloud data processing capability.

变化发送:是指当采集点的数据发生变化时向云端发送更新数据的方式,也即当采集点的数据未发生变化时,则无需向云端发送数据。Change sending: refers to the method of sending updated data to the cloud when the data at the collection point changes, that is, when the data at the collection point does not change, there is no need to send data to the cloud.

分段发送:是指通过划分时间片对数据进行发送的方式,可选地,时间片的划分是根据采集点的发送时间间隔进行的。示意性的,当前时间点为101秒,采集点的发送时间间隔为5秒,则将当前时间点与发送时间间隔相除,得到整数商20,并确定时间片20是否发送数据,当时间片20未发送数据时,则通过时间片20发送采集点的数据。Segmented sending: refers to the method of sending data by dividing time slices. Optionally, the division of time slices is performed according to the sending time interval of the collection point. Schematically, the current time point is 101 seconds, and the sending time interval of the collection point is 5 seconds, then divide the current time point by the sending time interval to obtain an integer quotient of 20, and determine whether to send data in the time slice 20, when the time slice When no data is sent at 20, the data of the collection point is sent through time slice 20.

定时发送:是指通过定义定时器控制数据发送的方式,通常通过定义链表或者二叉树的方式控制数据发送,然而,通过链表遍历的时间复杂度为O(n),二叉树遍历的时间复杂度为O(logn),在数据量较大的情况下,时间复杂度较高会造成服务器处理压力较大。可选地,本申请实施例中,定时发送方式通过定义双循环数组定时器实现。Timing sending: refers to the method of controlling data sending by defining a timer, usually by defining a linked list or a binary tree to control data sending, however, the time complexity of traversing through a linked list is O(n), and the time complexity of traversing a binary tree is O (logn), in the case of a large amount of data, the high time complexity will cause the server to process more pressure. Optionally, in the embodiment of the present application, the timing sending mode is implemented by defining a double-cycle array timer.

其次,对本申请实施例涉及的实时环境进行说明,如图1所示,该实施环境中包括服务器110、通信网络120和云端130;Secondly, the real-time environment involved in the embodiment of the present application is described, as shown in FIG. 1 , the implementation environment includes a server 110, a communication network 120, and a cloud 130;

其中,服务器110用于从各个采集点采集得到数据,并将数据通过通信网络120上传至云端130。可选地,服务器110可以从其他终端作为采集点采集数据,也可以从其他服务器采集数据,还可以采集自身生成的数据,本申请实施例对此不加以限定。Wherein, the server 110 is used to collect data from various collection points, and upload the data to the cloud 130 through the communication network 120 . Optionally, the server 110 may collect data from other terminals as collection points, may also collect data from other servers, and may also collect data generated by itself, which is not limited in this embodiment of the present application.

可选地,服务器110采集得到的数据可以是待计算的数据,也可以是待存储的数据,本申请实施例对此不加以限定。Optionally, the data collected by the server 110 may be data to be calculated or data to be stored, which is not limited in this embodiment of the present application.

可选地,服务器110将采集得到的数据通过通信网络120进行上传,该通信网络120可以是有线网络,也可以是无线网络。Optionally, the server 110 uploads the collected data through the communication network 120, and the communication network 120 may be a wired network or a wireless network.

可选地,上述服务器110可以实现为物理服务器,也可以实现为云服务器,服务器110可以实现为一台服务器,也可以实现为多台服务器组成的服务器集群。可选地,云端130接收到服务器上传的数据后,对数据进行计算处理,或对数据进行存储。Optionally, the above server 110 may be implemented as a physical server or as a cloud server, and the server 110 may be implemented as one server or as a server cluster composed of multiple servers. Optionally, after receiving the data uploaded by the server, the cloud 130 performs calculation processing on the data or stores the data.

结合上述名词简介,对本申请实施例中提供的数据发送方法进行说明,图2是本申请一个示例性实施例提供的数据发送方法的流程图,以该方法应用于服务器中为例进行说明,如图2所示,该方法包括:In combination with the above noun brief introduction, the data sending method provided in the embodiment of the present application is described. FIG. 2 is a flow chart of the data sending method provided in an exemplary embodiment of the present application. The application of the method in the server is used as an example for illustration, as shown in As shown in Figure 2, the method includes:

步骤201,获取目标采集点生成的目标数据,目标数据为待上传至云端的数据。Step 201, acquiring target data generated by the target collection point, where the target data is data to be uploaded to the cloud.

可选地,目标采集点可以实现为其他终端,也可以实现为其他服务器。可选地,其他终端可以是手机、平板电脑、便携式膝上笔记本电脑、智能可穿戴设备、车载设备等移动终端,也可以是台式电脑、监控设备、停车管理系统等终端,示意性的,以目标采集点实现为监控设备为例进行说明,该目标采集点对应设置有数据发送方式,由于监控设备为持续采集视频流的设备,故目标采集点对应的数据发送方式可以是实时发送,也可以是分段发送,还可以是定时发送,本申请实施例对此不加以限定。可选地,服务器获取目标数据后,需要将目标数据上传至云端进行进一步处理,如:存储处理、计算处理、识别处理等。Optionally, the target collection point may be implemented as another terminal or as another server. Optionally, other terminals may be mobile terminals such as mobile phones, tablet computers, portable laptop computers, smart wearable devices, and vehicle-mounted equipment, or terminals such as desktop computers, monitoring equipment, and parking management systems. Schematically, the The target collection point is implemented as a monitoring device as an example. The target collection point is correspondingly equipped with a data transmission method. Since the monitoring device is a device that continuously collects video streams, the data transmission method corresponding to the target collection point can be real-time transmission or It may be segmented transmission, or timing transmission, which is not limited in this embodiment of the present application. Optionally, after the server obtains the target data, it needs to upload the target data to the cloud for further processing, such as: storage processing, calculation processing, identification processing, and the like.

步骤202,确定与目标采集点对应的数据发送方式,数据发送方式中包括分段发送方式和定时发送方式中的至少一种。Step 202, determine a data transmission mode corresponding to the target collection point, and the data transmission mode includes at least one of a segmented transmission mode and a timing transmission mode.

可选地,不同的采集点对应的数据发送方式可以是不同的,也可以是相同的,目标采集点对应设置有数据发送方式。可选地,数据发送方式包括实时发送方式、变化发送方式、分段发送方式以及定时发送方式中的至少一种,可选地,目标采集点的数据发送方式包括分段发送方式和定时发送方式中的任意一种,也即,目标采集点可以通过分段发送方式发送目标数据,也可以通过定时发送方式发送目标数据。Optionally, the data sending methods corresponding to different collection points may be different or the same, and the target collection points are correspondingly provided with data sending methods. Optionally, the data sending method includes at least one of a real-time sending method, a variable sending method, a segmented sending method and a timing sending method, and optionally, the data sending method of the target collection point includes a segmented sending method and a timing sending method Any one of them, that is, the target collection point can send the target data in a segmented sending manner, or can send the target data in a timing sending manner.

可选地,分段发送方式表示划分时间片对数据进行发送的方式;定时发送方式表示定义双循环数据定时器对数据进行发送的方式。Optionally, the segmented sending mode means a way of dividing time slices to send data; the timing sending way means a way of defining a double-cycle data timer to send data.

针对分段发送方式和定时发送方式分别进行说明:Instructions for the segmented sending method and the scheduled sending method are given separately:

第一,分段发送方式:目标采集点还对应设置有发送时间间隔,确定目标采集点的发送时间间隔以及当前时间点后,结合当前时间点与发送时间间隔,确定目标采集点对应的目标时间片,并在目标时间片内将目标数据上传至云端;First, the segmented sending method: the target collection point is also set with a corresponding sending time interval. After determining the sending time interval of the target collecting point and the current time point, combine the current time point and the sending time interval to determine the target time corresponding to the target collecting point slice, and upload the target data to the cloud within the target time slice;

第二,定时发送方式:将目标采集点挂载至双循环数组定时器上,该双循环数组定时器对应有游标指针,当游标指针指向目标采集点所挂载的位置时,将目标数据上传至云端。Second, the timing sending method: mount the target collection point on the double-cycle array timer, and the double-cycle array timer corresponds to a cursor pointer. When the cursor pointer points to the location where the target collection point is mounted, upload the target data to the cloud.

步骤203,以数据发送方式将目标数据上传至云端。Step 203, uploading the target data to the cloud by means of data transmission.

可选地,当目标采集点对应设置的数据发送方式为分段发送方式时,则以分段发送方式发送目标数据;当目标采集点对应设置的数据发送方式为定时发送方式时,则以定时发送方式发送目标数据。Optionally, when the data transmission mode corresponding to the target collection point is a segmented transmission mode, the target data is sent in a segmented transmission mode; when the data transmission mode corresponding to the target collection point is a timing transmission mode, the timing The sending method sends the target data.

综上所述,本申请实施例提供的数据发送方法,通过向目标采集点设置对应的数据发送方式,并向目标采集点设置分段发送方式或定时发送方式,从而以时间片的形式降低数据发送的时间复杂度,或以双循环数组定时器降低数据发送的时间复杂度,减缓数据发送过程中的带宽压力,以及减缓云端的数据处理压力,提高了数据的发送处理效率。To sum up, the data transmission method provided by the embodiment of the present application sets the corresponding data transmission mode to the target collection point, and sets the segmented transmission mode or timing transmission mode to the target collection point, thereby reducing data in the form of time slices. The time complexity of sending, or using a double-loop array timer to reduce the time complexity of data sending, slow down the bandwidth pressure during data sending, and slow down the data processing pressure on the cloud, improving the efficiency of data sending and processing.

在一个可选的实施例中,针对上述分段发送方式发送目标数据的情况进行说明,图3是本申请一个示例性实施例提供的数据发送方法的流程图,以该方法应用于服务器中为例进行说明,如图3所示,该方法包括:In an optional embodiment, the above-mentioned situation of sending target data in segmented sending mode is described. FIG. 3 is a flow chart of a data sending method provided in an exemplary embodiment of the present application. For example, as shown in Figure 3, the method includes:

步骤301,获取目标采集点生成的目标数据,目标数据为待上传至云端的数据。Step 301, acquiring target data generated by the target collection point, where the target data is data to be uploaded to the cloud.

可选地,目标采集点可以实现为其他终端,也可以实现为其他服务器。可选地,其他终端可以是手机、平板电脑、便携式膝上笔记本电脑、智能可穿戴设备、车载设备等移动终端,也可以是台式电脑、监控设备、停车管理系统等终端。Optionally, the target collection point may be implemented as another terminal or as another server. Optionally, other terminals may be mobile terminals such as mobile phones, tablet computers, portable laptop computers, smart wearable devices, and vehicle-mounted devices, or terminals such as desktop computers, monitoring equipment, and parking management systems.

可选地,服务器获取目标数据后,需要将目标数据上传至云端进行进一步处理,如:存储处理、计算处理、识别处理等。Optionally, after the server obtains the target data, it needs to upload the target data to the cloud for further processing, such as: storage processing, calculation processing, identification processing, and the like.

步骤302,确定与目标采集点对应的数据发送方式。Step 302, determining the data sending mode corresponding to the target collection point.

可选地,与目标采集点对应设置的数据发送方式为分段发送方式,该分段发送方式用于表示划分时间片对数据进行发送的方式。可选地,在划分时间片时,根据目标采集点的发送时间间隔进行划分,发送时间间隔为目标采集点对应设置的在相邻两次数据发送之间的时间间隔。Optionally, the data sending mode set corresponding to the target collection point is a segmented sending mode, and the segmented sending mode is used to indicate a way of dividing time slices to send data. Optionally, when dividing the time slice, it is divided according to the sending time interval of the target collection point, and the sending time interval is the time interval between two adjacent data transmissions correspondingly set by the target collection point.

步骤303,确定目标采集点的发送时间间隔以及当前时间点。Step 303, determine the sending time interval and the current time point of the target collection point.

可选地,当前时间点为根据服务器的机器时间换算得到的时间戳,可选地,将机器时间以单一时间单位进行换算,可选地,换算方式根据目标采集点的发送时间间隔确定,将服务器的机器时间换算至与发送时间间隔同级的时间单位。示意性的,目标采集点的发送时间间隔为5秒,则将服务器的机器时间换算为以秒为单位的时间戳,如:当前服务器的机器时间为00:02:41,则换算至以秒为单位即为101秒,可选地,本申请对机器时间换算至时间戳的换算方式不加以限定。Optionally, the current time point is a time stamp converted according to the machine time of the server. Optionally, the machine time is converted in a single time unit. Optionally, the conversion method is determined according to the sending time interval of the target collection point. The server's machine time is converted to the same time unit as the sending interval. Schematically, if the sending time interval of the target collection point is 5 seconds, then the server's machine time is converted to a timestamp in seconds, for example: the current server's machine time is 00:02:41, then it is converted to seconds The unit is 101 seconds. Optionally, this application does not limit the conversion method of converting machine time to timestamp.

可选地,发送时间间隔为目标采集点对应设置有的时间间隔,发送时间间隔用于控制目标采集点发送相邻两次数据之间的时间间隔,通过发送时间间隔划分时间片,则在当前第i个时间片发送目标采集点的数据后,在第i+1个时间片不发送目标采集点的数据,并当存在目标采集点的数据时,在第i+2个时间片进行发送,也即,目标采集点的数据在发送时,相邻两次发送之间需要间隔预先设定的发送时间间隔,可选地,上述第i+1个时间片不发送目标采集点采集的数据,可以发送其他采集点采集的数据,i为正整数。Optionally, the sending time interval is the time interval set corresponding to the target collection point, and the sending time interval is used to control the time interval between two adjacent data transmissions of the target collection point, and the time slice is divided by the sending time interval, then in the current After the data of the target collection point is sent in the i-th time slice, the data of the target collection point is not sent in the i+1 time slice, and when there is data of the target collection point, it is sent in the i+2 time slice, That is, when the data of the target collection point is sent, a preset sending time interval is required between two adjacent transmissions. Optionally, the above i+1th time slice does not send the data collected by the target collection point, Data collected by other collection points can be sent, and i is a positive integer.

步骤304,将当前时间点与发送时间间隔相除,得到整数商作为目标采集点的目标时间片。Step 304, dividing the current time point by the sending time interval to obtain an integer quotient as the target time slice of the target collection point.

示意性的,以上述当前时间点为101秒,发送时间间隔为5秒为例进行说明,将当前时间点101秒与发送时间间隔5秒相除,得到整数商为20,则将时间片20作为目标采集点的候选时间片,也即当时间片20未被标记发送数据时,通过时间片20发送目标数据。Schematically, take the above-mentioned current time point of 101 seconds and the sending time interval of 5 seconds as an example for illustration, divide the current time point of 101 seconds by the sending time interval of 5 seconds, and obtain an integer quotient of 20, then divide the time slice of 20 As a candidate time slot for the target collection point, that is, when the time slot 20 is not marked for sending data, the target data is sent through the time slot 20 .

步骤305,响应于候选时间片内未发送过数据,在目标时间片将目标数据上传至云端。Step 305, uploading the target data to the cloud in the target time slot in response to no data being sent in the candidate time slot.

可选地,根据时间片上的标记确定时间片是否发送过数据,如:使用时间片记录标志Flag记录已经放过数据的时间片,Flag取值为n时,标识时间片n发送过数据,当目标时间片被标记时,表示目标时间片内发送过数据,则丢弃当前目标采集点采集得到的目标数据;当目标时间片未被标记时,表示目标时间片内未发送过数据,在目标时间片对目标数据进行发送。Optionally, determine whether the time slice has sent data according to the mark on the time slice, such as: use the time slice record flag Flag to record the time slice that has let go of data, when the value of Flag is n, identify that time slice n has sent data, when When the target time slice is marked, it means that data has been sent within the target time slice, and the target data collected by the current target collection point is discarded; when the target time slice is not marked, it means that no data has been sent within the target time slice, and the target time The chip sends the target data.

可选地,针对发送时间间隔不同的采集点,可以通过并列时间线的方式对时间片进行划分。Optionally, for collection points with different sending time intervals, time slices may be divided in a manner of parallel timelines.

示意性的,请参考图4,其示出了本申请一个示例性实施例提供的分段发送方式的示意图,如图4所示,以当前时间点为101秒,第一采集点的发送时间间隔为5秒为例,则第一采集点的候选时间片为101秒与5秒相除得到的整数商,即20,则将第20个时间片作为第一采集点的候选时间片,当第20个时间片未被标记时,表示第20个时间片未发送数据,则将第20个时间片作为目标时间片并用于发送第一采集点的目标数据。可选地,单个时间片内仅能发送一次数据,故当103秒时存在数据待发送时,则不在第20个时间片对103秒产生的数据发送。可选地,由于第一采集点对应有发送时间间隔5秒,故在第20个时间片对第一采集点的数据进行发送后,在第21个时间点无法对第一采集点的数据进行发送,并在第22个时间点能够继续对第一采集点的数据进行发送。Schematically, please refer to FIG. 4, which shows a schematic diagram of a segmented transmission method provided by an exemplary embodiment of the present application. As shown in FIG. 4, the current time point is 101 seconds, and the transmission time of the first collection point If the interval is 5 seconds as an example, then the candidate time slice of the first collection point is the integer quotient obtained by dividing 101 seconds by 5 seconds, that is, 20, then the 20th time slice is taken as the candidate time slice of the first collection point, when When the 20th time slot is not marked, it means that no data is sent in the 20th time slot, and the 20th time slot is used as the target time slot and used to send the target data of the first collection point. Optionally, data can only be sent once in a single time slot, so when there is data to be sent at 103 seconds, the data generated at 103 seconds is not sent in the 20th time slot. Optionally, since the first collection point corresponds to a sending time interval of 5 seconds, after the data of the first collection point is sent in the 20th time slice, the data of the first collection point cannot be sent at the 21st time point Send, and continue to send the data of the first collection point at the 22nd time point.

示意性的,请参考图5,其示出了本申请另一个示例性实施例提供的分段发送方式的示意图,如图5所示,以当前时间点为101秒,第二采集点的发送时间间隔为10秒为例,则第二采集点的候选时间片为101秒与10秒相除得到的整数商,即10,则将第10个时间片作为第二采集点的候选时间片,当第10个时间片未被标记时,表示第10个时间片未发送数据,则将第10个时间片作为目标时间片并用于发送第二采集点的目标数据。可选地,由于第二采集点对应有发送时间间隔10秒,故在第10个时间片对第二采集点的数据进行发送后,在第11个时间片无法对第二采集点的数据进行发送,并在第12个时间点能够继续对第一采集点的数据进行发送。可选地,在第11个时间片可以对第三采集点的数据进行发送,该第三采集点的发送时间间隔与第二采集点一致,皆为10秒。Schematically, please refer to FIG. 5, which shows a schematic diagram of a segmented transmission method provided by another exemplary embodiment of the present application. As shown in FIG. 5, the current time point is 101 seconds, and the transmission at the second collection point The time interval is 10 seconds as an example, then the candidate time slice of the second collection point is the integer quotient obtained by dividing 101 seconds and 10 seconds, that is, 10, then the 10th time slice is taken as the candidate time slice of the second collection point, When the 10th time slot is not marked, it means that no data is sent in the 10th time slot, and the 10th time slot is used as the target time slot and used to send the target data of the second collection point. Optionally, since the second collection point corresponds to a sending time interval of 10 seconds, after the data at the second collection point is sent in the 10th time slot, the data at the second collection point cannot be sent in the 11th time slot. Send, and continue to send the data of the first collection point at the 12th time point. Optionally, in the 11th time slot, the data of the third collection point may be sent, and the sending time interval of the third collection point is consistent with that of the second collection point, both being 10 seconds.

综上所述,本申请实施例提供的数据发送方法,通过向目标采集点设置对应的数据发送方式,并向目标采集点设置分段发送方式或定时发送方式,从而以时间片的形式降低数据发送的时间复杂度,或以双循环数组定时器降低数据发送的时间复杂度,减缓数据发送过程中的带宽压力,以及减缓云端的数据处理压力,提高了数据的发送处理效率。To sum up, the data transmission method provided by the embodiment of the present application sets the corresponding data transmission mode to the target collection point, and sets the segmented transmission mode or timing transmission mode to the target collection point, thereby reducing data in the form of time slices. The time complexity of sending, or using a double-loop array timer to reduce the time complexity of data sending, slow down the bandwidth pressure during data sending, and slow down the data processing pressure on the cloud, improving the efficiency of data sending and processing.

本实施例提供的方法,通过分段发送方式,基于时间片触发数据的发送,且时间片的计算方式时通过当前时间点与发送时间间隔的整数商,故时间复杂度为O(1),降低了数据发送过程中的时间复杂度,从而降低了服务器的数据发送压力,以及减缓了带宽压力和云端的数据处理压力。The method provided in this embodiment triggers the sending of data based on the time slice through the segmented sending method, and the time slice is calculated by the integer quotient of the current time point and the sending time interval, so the time complexity is O(1). The time complexity in the data sending process is reduced, thereby reducing the data sending pressure of the server, and relieving the bandwidth pressure and the data processing pressure of the cloud.

在一个可选的实施例中,针对上述定时发送方式发送目标数据的情况进行说明,图6是本申请一个示例性实施例提供的数据发送方法的流程图,以该方法应用于服务器中为例进行说明,如图6所示,该方法包括:In an optional embodiment, the above-mentioned situation of sending target data in a regular sending manner is described. FIG. 6 is a flow chart of a data sending method provided in an exemplary embodiment of the present application, taking the method applied to a server as an example To illustrate, as shown in Figure 6, the method includes:

步骤601,获取目标采集点生成的目标数据,目标数据为待上传至云端的数据。Step 601, acquiring target data generated by the target collection point, where the target data is data to be uploaded to the cloud.

可选地,目标采集点可以实现为其他终端,也可以实现为其他服务器。可选地,其他终端可以是手机、平板电脑、便携式膝上笔记本电脑、智能可穿戴设备、车载设备等移动终端,也可以是台式电脑、监控设备、停车管理系统等终端。Optionally, the target collection point may be implemented as another terminal or as another server. Optionally, other terminals may be mobile terminals such as mobile phones, tablet computers, portable laptop computers, smart wearable devices, and vehicle-mounted devices, or terminals such as desktop computers, monitoring equipment, and parking management systems.

可选地,服务器获取目标数据后,需要将目标数据上传至云端进行进一步处理,如:存储处理、计算处理、识别处理等。Optionally, after the server obtains the target data, it needs to upload the target data to the cloud for further processing, such as: storage processing, calculation processing, identification processing, and the like.

步骤602,确定与目标采集点对应的数据发送方式。Step 602, determine the data sending mode corresponding to the target collection point.

可选地,与目标采集点对应设置的数据发送方式为定时发送方式,该定时发送方式用于表示定义双循环数组定时器对数据进行发送的方式。Optionally, the data sending mode set corresponding to the target collection point is a timing sending mode, and the timing sending mode is used to indicate a way of defining a double-cycle array timer to send data.

可选地,该双循环数组定时器中包括两个不同时间单位的定时数组。Optionally, the double-cycle array timer includes two timing arrays with different time units.

可选地,双循环数组定时器中包括第一定时数组和第二定时数组,其中,第一定时数组以第一时间单位进行定时,第二定时数组以第二时间单位进行定时,且第一时间单位的精度高于第二时间单位的精度,第一定时数组的数组元素数量与第一时间单位的精度能够对应换算得到第二时间单位的精度,如:第一定时数组的第一时间单位为秒,第二定时数组的第二时间单位为小时,则第一定时数组包括3600个数组元素,3600秒换算得到1小时。示意性的,第一定时数组和第二定时数组包括如下情况中的至少一种:Optionally, the double-cycle array timer includes a first timing array and a second timing array, wherein the first timing array is timing with a first time unit, the second timing array is timing with a second time unit, and the first timing array is timing with a second time unit. The precision of the time unit is higher than the precision of the second time unit. The number of array elements of the first timing array and the precision of the first time unit can be converted correspondingly to obtain the precision of the second time unit, such as: the first time unit of the first timing array is seconds, and the second time unit of the second timing array is hour, then the first timing array includes 3600 array elements, and 3600 seconds is converted to get 1 hour. Schematically, the first timing array and the second timing array include at least one of the following situations:

第一,第一定时数组为秒级定时数组,第二定时数组为分钟级定时数组;First, the first timing array is a second-level timing array, and the second timing array is a minute-level timing array;

可选地,第一定时数组中包括60个数组元素,第二定时数组包括240个数组元素,第一定时数组循环一圈时,第二定时数组后移一位。Optionally, the first timing array includes 60 array elements, the second timing array includes 240 array elements, and when the first timing array loops once, the second timing array is shifted backward by one bit.

第二,第一定时数组为秒级定时数组,第二定时数组为小时级定时数组;Second, the first timing array is a second-level timing array, and the second timing array is an hour-level timing array;

可选地,第一定时数组中包括3600个数组元素,第二定时数组中包括240个数组元素,第一定时数组循环一圈时,第二定时数组后移一位;Optionally, the first timing array includes 3600 array elements, and the second timing array includes 240 array elements. When the first timing array loops around, the second timing array is shifted backward by one bit;

第三,第一定时数组为分钟级定时数组,第二定时数组为小时级定时数组;Third, the first timing array is a minute-level timing array, and the second timing array is an hour-level timing array;

可选地,第一定时数组中包括60个数组元素,第二定时数组中包括240个数组元素,第一定时数组循环一圈时,第二定时数组后移一位;Optionally, the first timing array includes 60 array elements, and the second timing array includes 240 array elements. When the first timing array loops around, the second timing array is shifted by one bit;

第四,第一定时数组为小时级数组,第二定时数组为日期级数组;、Fourth, the first timing array is an hour-level array, and the second timing array is a date-level array;,

可选地,第一定时数组中包括24个数组元素,第二定时数组中包括30个数组元素,第一定时数组循环一圈时,第二定时数组后移一位。Optionally, the first timing array includes 24 array elements, and the second timing array includes 30 array elements, and when the first timing array makes a circle, the second timing array is shifted backward by one bit.

步骤603,响应于目标采集点的发送时间间隔小于第二时间单位的精度,将目标采集点挂载至第一定时数组上。Step 603, in response to the sending time interval of the target collection point being less than the precision of the second time unit, mount the target collection point on the first timing array.

可选地,双循环数组定时器对应有游标指针,且第一定时数组上对应有第一指针,第二定时数组上对应有第二指针,且第一定时数组的第一指针循环移动一圈后,第二定时数组上的第二指针向后移动一个位置,示意性的,请参考图7,其示出了双循环数组定时器700中的秒级数组710和小时级数组720,其中,秒级数组710中包括3600个数组元素,小时级数组720中包括240个数组元素,示意性的,当前小时级数组720中指针指向数组元素4,当秒级数组710中指针循环移动从1至3600后,小时级数组720中指针指向数组元素5,示意性的,如图7所示,第二时间单位的精度为小时,也即3600秒,故当目标采集点的发送时间间隔为60秒时,在秒级数组710上挂载该目标采集点,示意性的,如图7所示的采集点711和采集点712即为秒级数组710上挂载的采集点,且采集点711和采集点712对应的时间间隔不同,当采集点711和采集点712的时间间隔相同时,采集点711和采集点712挂载在同一个数组元素上。Optionally, the double-cycle array timer corresponds to a cursor pointer, and the first timing array corresponds to a first pointer, and the second timing array corresponds to a second pointer, and the first pointer of the first timing array moves a circle Afterwards, the second pointer on the second timing array moves back one position. Schematically, please refer to FIG. The second-level array 710 includes 3600 array elements, and the hour-level array 720 includes 240 array elements. Schematically, the pointer in the current hour-level array 720 points to array element 4. When the pointer in the second-level array 710 moves circularly from 1 to After 3600, the pointer in the hour-level array 720 points to array element 5. Schematically, as shown in FIG. , the target collection point is mounted on the second-level array 710. Schematically, the collection point 711 and the collection point 712 shown in FIG. 7 are the collection points mounted on the second-level array 710, and the collection point 711 and The time intervals corresponding to the collection points 712 are different. When the time intervals of the collection points 711 and 712 are the same, the collection points 711 and 712 are mounted on the same array element.

步骤604,响应于发送时间间隔大于第二时间单位精度,将目标采集点挂载至第二定时数组上。Step 604, in response to the sending time interval being greater than the precision of the second time unit, mount the target collection point on the second timing array.

示意性的,如图7所示,第二时间单位的精度为小时,也即3600秒,故当目标采集点的发送时间间隔为4000秒时,在小时级数组720上挂载该目标采集点,如图7所示的采集点721和采集点722即为小时级数组720上挂载的采集点,可选地,当挂载在小时级数组720上时,采集点721和采集点722对应的时间间隔可以相同也可以不同。Schematically, as shown in Figure 7, the accuracy of the second time unit is hours, that is, 3600 seconds, so when the sending time interval of the target collection point is 4000 seconds, the target collection point is mounted on the hour-level array 720 , the collection point 721 and the collection point 722 shown in Figure 7 are the collection points mounted on the hour-level array 720. Optionally, when mounted on the hour-level array 720, the collection point 721 and the collection point 722 correspond to The time intervals can be the same or different.

步骤605,响应于游标指针指向目标采集点所挂载的位置,将目标数据上传至云端。Step 605, uploading the target data to the cloud in response to the fact that the cursor pointer points to the mounted position of the target collection point.

可选地,针对目标采集点挂载在第一定时数组和第二定时数组上分别进行说明:Optionally, the target collection point is mounted on the first timing array and the second timing array are described separately:

一、当目标采集点挂载在第一定时数组上时,根据第一指针根据时间的移动,当第一指针指向目标采集点在第一定时数组上所处的元素位置时,将目标数据上传至云端。1. When the target collection point is mounted on the first timing array, according to the movement of the first pointer according to time, when the first pointer points to the element position of the target collection point on the first timing array, upload the target data to the cloud.

可选地,以发送时间间隔对目标采集点在双循环数组定时器上的挂载位置进行更新,也即以发送时间间隔对目标采集在第一定时数组上的位置进行更新。可选地,确定目标采集点在第一定时数组上当前挂载的第一位置点,并在第一定时数组中循环确定第一位置点移动与发送时间间隔对应长度后的第二位置点,将目标采集点挂载至第二位置点。Optionally, the mounting position of the target collection point on the double-cycle array timer is updated at the sending time interval, that is, the position of the target collection point on the first timing array is updated at the sending time interval. Optionally, determine the first position point currently mounted on the first timing array of the target collection point, and loop through the first timing array to determine the second position point after the first position point has moved to a length corresponding to the sending time interval, Mount the target collection point to the second location point.

示意性的,目标采集点当前所处的位置为i,发送时间间隔为j,且j<3600,则目标采集点更新后的位置为(i+j)mod3600,示意性的,如图8所示,在双循环数组定时器800中包括秒级定时数组810和小时级定时数组820,其中,秒级定时数组810当前指向数组元素3,该数组元素3为目标采集点挂载的位置,目标采集点的发送时间间隔为3,则当目标采集点的数据被发送时,目标采集点更新挂载至位置6。Schematically, the current position of the target collection point is i, the sending time interval is j, and j<3600, then the updated position of the target collection point is (i+j)mod3600, schematically, as shown in Figure 8 As shown, the double-cycle array timer 800 includes a second-level timing array 810 and an hour-level timing array 820, wherein the second-level timing array 810 currently points to array element 3, which is the location where the target collection point is mounted, and the target The sending interval of the collection point is 3, then when the data of the target collection point is sent, the target collection point is updated and mounted to position 6.

可选地,当目标采集点当前所处的位置为i,发送时间间隔为j,第二定时数组当前指向数组元素m,且j>3600,则计算(i+j)/3600取整,并与m相加,得到目标采集点在第二定时数组上更新后的挂载位置。Optionally, when the current position of the target collection point is i, the sending time interval is j, the second timing array is currently pointing to the array element m, and j>3600, then the calculation (i+j)/3600 is rounded, and Add it to m to obtain the updated mounting position of the target collection point on the second timing array.

二、当目标采集点挂载在第二定时数组上时,首先,响应于第二指针指向目标采集点在第二定时数组上挂载的第三位置,结合发送时间间隔将目标采集点移动至第一定时数组的第四位置处,并响应于第一指针指向第一定时数组中的第四位置处,将目标数据上传至云端。2. When the target collection point is mounted on the second timing array, first, in response to the second pointer pointing to the third position of the target collection point mounted on the second timing array, the target collection point is moved to the second timing array in combination with the sending time interval At the fourth position of the first timing array, and in response to the first pointer pointing to the fourth position in the first timing array, the target data is uploaded to the cloud.

可选地,响应于第二定时数组上的第二指针指向第三位置,结合发送时间间隔将目标采集点移动至第四位置处,并响应于第一指针指向第四位置,将目标数据上传至云端。可选地,当目标采集点的发送时间间隔大于第二定时数组的时间单位时,根据当前第二指针的指示位置和发送时间间隔确定目标采集点在当前第二定时数组中的挂载位置。示意性的,将发送时间间隔与第一定时数组的数组元素数量相除,得到整数商,将整数商与当前第二指针的指示位置相加,得到目标采集点在第二定时数组中的挂载位置。示意性的,m为当前小时数组的游标指针指示位置,i为当前秒级数组的游标指针指示位置,也是当前目标采集点在秒级数组中的挂载位置,目标采集点的发送时间间隔为j,且j>3600,则计算j与3600相除后的整数商n,并将目标采集点挂载至下标为(m+n)%240的小时级数组元素中,其中,240为第二定时数组的数组长度,计算j%3600得到k,则(i+k)%3600即为目标采集点下一次在秒级数组中的挂载位置,其中,3600为第一定时数组的数组长度。示意性的,当小时级数组的游标指针移动至m+n的位置处时,将目标采集点取出,并放入秒级数组中,示意性的,秒级数组在最近一次移动至目标采集点挂载位置时,游标指针指向i,目标采集点定时间隔为j,则计算j%3600,并与i相加,得到当前目标采集点在秒级数组中的挂载位置,上述m、n、i、j皆为正整数。Optionally, in response to the second pointer on the second timing array pointing to the third position, the target collection point is moved to the fourth position in combination with the sending time interval, and in response to the first pointer pointing to the fourth position, the target data is uploaded to the cloud. Optionally, when the sending time interval of the target collection point is greater than the time unit of the second timing array, the mounting position of the target collection point in the current second timing array is determined according to the indicated position of the current second pointer and the sending time interval. Schematically, the sending time interval is divided by the number of array elements in the first timing array to obtain an integer quotient, and the integer quotient is added to the current indicated position of the second pointer to obtain the linked position of the target collection point in the second timing array load location. Schematically, m is the position indicated by the cursor pointer of the current hour array, and i is the position indicated by the cursor pointer of the current second-level array, which is also the mounting position of the current target collection point in the second-level array. The sending time interval of the target collection point is j, and j>3600, then calculate the integer quotient n after dividing j and 3600, and mount the target collection point to the hour-level array element with the subscript (m+n)%240, where 240 is the first The array length of the second timing array, calculate j%3600 to get k, then (i+k)%3600 is the next mounting position of the target collection point in the second-level array, and 3600 is the array length of the first timing array . Schematically, when the cursor pointer of the hour-level array moves to the position of m+n, the target collection point is taken out and put into the second-level array. Schematically, the second-level array moves to the target collection point the last time When mounting the position, the cursor pointer points to i, and the timing interval of the target collection point is j, then calculate j%3600 and add it to i to obtain the mounting position of the current target collection point in the second-level array. The above m, n, i and j are both positive integers.

综上所述,本申请实施例提供的数据发送方法,通过向目标采集点设置对应的数据发送方式,并向目标采集点设置分段发送方式或定时发送方式,从而以时间片的形式降低数据发送的时间复杂度,或以双循环数组定时器降低数据发送的时间复杂度,减缓数据发送过程中的带宽压力,以及减缓云端的数据处理压力,提高了数据的发送处理效率。To sum up, the data transmission method provided by the embodiment of the present application sets the corresponding data transmission mode to the target collection point, and sets the segmented transmission mode or timing transmission mode to the target collection point, thereby reducing data in the form of time slices. The time complexity of sending, or using a double-loop array timer to reduce the time complexity of data sending, slow down the bandwidth pressure during data sending, and slow down the data processing pressure on the cloud, improving the efficiency of data sending and processing.

本实施例提供的方法,通过定时发送方式,基于双循环数组定时器触发数据的发送,且双循环数组定时器可以直接获取下标得到数组元素,即获取时间,故时间复杂度接近O(1),降低了数据发送过程中的时间复杂度,从而降低了服务器的数据发送压力,以及减缓了带宽压力和云端的数据处理压力。The method provided in this embodiment is based on the double-cycle array timer to trigger the sending of data through the timing sending method, and the double-cycle array timer can directly obtain the subscript to obtain the array element, that is, the time, so the time complexity is close to O(1 ), which reduces the time complexity of the data sending process, thereby reducing the data sending pressure of the server, and alleviating the bandwidth pressure and the data processing pressure of the cloud.

图9是本申请一个示例性实施例提供的数据发送装置的结构框图,以该装置应用于服务器中为例进行说明,如图9所示,该装置包括:获取模块910、确定模块920和发送模块930;Fig. 9 is a structural block diagram of a data sending device provided by an exemplary embodiment of the present application. The device is used in a server as an example for illustration. As shown in Fig. 9, the device includes: an acquisition module 910, a determination module 920 and a sending module module 930;

获取模块910,用于获取目标采集点生成的目标数据,所述目标数据为待上传至云端的数据;An acquisition module 910, configured to acquire target data generated by the target collection point, where the target data is data to be uploaded to the cloud;

确定模块920,用于确定与所述目标采集点对应的数据发送方式,所述数据发送方式中包括分段发送方式和定时发送方式中的至少一种,其中,所述分段发送方式表示划分时间片对数据进行发送的方式,所述定时发送方式表示定义双循环数组定时器对数据进行发送的方式;The determination module 920 is configured to determine a data transmission mode corresponding to the target collection point, the data transmission mode includes at least one of a segmented transmission mode and a timing transmission mode, wherein the segmented transmission mode represents division Time slice sends the mode of data, and described regular sending mode represents the mode that defines double cycle array timer to send data;

发送模块930,用于以所述数据发送方式将所述目标数据上传至所述云端。The sending module 930 is configured to upload the target data to the cloud in the data sending manner.

在一个可选的实施例中,所述数据发送方式包括所述分段发送方式;In an optional embodiment, the data sending method includes the segmented sending method;

所述确定模块920,还用于确定所述目标采集点的发送时间间隔以及当前时间点;结合所述当前时间点与所述发送时间间隔,确定所述目标采集点对应的目标时间片;The determining module 920 is further configured to determine the sending time interval and the current time point of the target collection point; combine the current time point and the sending time interval to determine the target time slice corresponding to the target collection point;

所述发送模块930,还用于在所述目标时间片将所述目标数据上传至所述云端。The sending module 930 is further configured to upload the target data to the cloud in the target time slice.

在一个可选的实施例中,所述确定模块920,还用于响应于所述目标时间片内未发送过数据,在所述目标时间片将所述目标数据上传至所述云端。In an optional embodiment, the determining module 920 is further configured to upload the target data to the cloud in the target time slot in response to no data being sent within the target time slot.

在一个可选的实施例中,所述数据发送方式包括所述定时发送方式;In an optional embodiment, the data sending method includes the timing sending method;

如图10所示,所述装置还包括:As shown in Figure 10, the device also includes:

挂载模块940,用于将所述目标采集点挂载至所述双循环数组定时器上,所述双循环数组定时器对应有游标指针;Mounting module 940, configured to mount the target collection point on the double-cycle array timer, and the double-cycle array timer corresponds to a cursor pointer;

所述发送模块930,还用于响应于所述游标指针指向所述目标采集点所挂载的位置,将所述目标数据上传至所述云端。The sending module 930 is further configured to upload the target data to the cloud in response to the cursor pointing to the location where the target collection point is mounted.

在一个可选的实施例中,所述双循环数组定时器中包括第一定时数组和第二定时数组,所述第一定时数组以第一时间单位进行定时,所述第二定时数组以第二时间单位进行定时,所述第一时间单位的精度高于所述第二时间单位的精度,且所述第一定时数组的数组元素数量与所述第一时间单位的精度能够对应换算得到所述第二时间单位的精度;In an optional embodiment, the double-cycle array timer includes a first timing array and a second timing array, the first timing array is timed by the first time unit, and the second timing array is timed by the second time unit. Two time units are used for timing, the precision of the first time unit is higher than the precision of the second time unit, and the number of array elements of the first timing array and the precision of the first time unit can be converted correspondingly to obtain the the precision of the second time unit described;

所述挂载模块940,还用于响应于所述目标采集点的发送时间间隔小于所述第二时间单位的精度,将所述目标采集点挂载至所述第一定时数组上;响应于所述发送时间间隔大于所述第二时间单位的精度,将所述目标采集点挂载至所述第二定时数组上。The mounting module 940 is further configured to mount the target collection point on the first timing array in response to the sending time interval of the target collection point being less than the accuracy of the second time unit; in response The sending time interval is greater than the precision of the second time unit, and the target collection point is mounted on the second timing array.

在一个可选的实施例中,所述挂载模块940,还用于以所述发送时间间隔对所述目标采集点在所述双循环数组定时器上的挂载位置进行更新。In an optional embodiment, the mounting module 940 is further configured to update the mounting position of the target collection point on the double-cycle array timer at the sending time interval.

在一个可选的实施例中,所述目标采集点挂载在所述第一定时数组上;In an optional embodiment, the target collection point is mounted on the first timing array;

所述确定模块920,还用于确定所述目标采集点在所述第一定时数组上当前挂载的第一位置点;在所述第一定时数组中循环确定所述第一位置点移动与所述发送时间间隔对应长度后的第二位置点;The determination module 920 is further configured to determine the first position point currently mounted on the first timing array of the target collection point; and determine the movement and the movement of the first position point cyclically in the first timing array The second position point after the corresponding length of the sending time interval;

所述挂载模块940,还用于将所述目标采集点挂载至所述第二位置点。The mounting module 940 is further configured to mount the target collection point to the second location point.

在一个可选的实施例中,所述目标采集点挂载在所述第二定时数组上,所述游标指针包括第一指针和第二指针,所述第一指针与所述第一定时数组对应,所述第二指针与所述第二定时数组对应;In an optional embodiment, the target collection point is mounted on the second timing array, the cursor pointer includes a first pointer and a second pointer, and the first pointer and the first timing array Correspondingly, the second pointer corresponds to the second timing array;

所述挂载模块940,还用于响应于所述第二指针指向所述目标采集点在所述第二定时数组上挂载的第三位置;结合所述发送时间间隔将所述目标采集点移动至所述第一定时数组的第四位置处;The mounting module 940 is further configured to respond to the second pointer pointing to a third position where the target collection point is mounted on the second timing array; combine the sending time interval with the target collection point moving to the fourth position of the first timing array;

所述发送模块930,还用于响应于所述第一指针指向所述第一定时数组中的所述第四位置处,将所述目标数据上传至所述云端。The sending module 930 is further configured to upload the target data to the cloud in response to the first pointer pointing to the fourth position in the first timing array.

综上所述,本申请实施例提供的数据发送装置,通过向目标采集点设置对应的数据发送方式,并向目标采集点设置分段发送方式或定时发送方式,从而以时间片的形式降低数据发送的时间复杂度,或以双循环数组定时器降低数据发送的时间复杂度,减缓数据发送过程中的带宽压力,以及减缓云端的数据处理压力,提高了数据的发送处理效率。To sum up, the data sending device provided by the embodiment of the present application sets a corresponding data sending method to the target collection point, and sets a segmented sending method or a timing sending method to the target collecting point, thereby reducing data in the form of time slices. The time complexity of sending, or using a double-loop array timer to reduce the time complexity of data sending, slow down the bandwidth pressure during data sending, and slow down the data processing pressure on the cloud, improving the efficiency of data sending and processing.

需要说明的是:上述实施例提供的数据发送装置,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的数据发送装置与数据发送方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that the data sending device provided by the above-mentioned embodiments is only illustrated by the division of the above-mentioned functional modules. In practical applications, the above-mentioned function allocation can be completed by different functional modules according to needs, that is, the internal structure of the device Divided into different functional modules to complete all or part of the functions described above. In addition, the data sending device and the data sending method embodiment provided by the above embodiment belong to the same idea, and the specific implementation process thereof is detailed in the method embodiment, and will not be repeated here.

图11示出了本申请一个示例性实施例提供的服务器的结构示意图。该服务器可以是图1示出的服务器。具体来讲:Fig. 11 shows a schematic structural diagram of a server provided by an exemplary embodiment of the present application. The server may be the server shown in FIG. 1 . Specifically:

服务器1100包括中央处理单元(CPU,Central Processing Unit)1101、包括随机存取存储器(RAM,Random Access Memory)1102和只读存储器(ROM,Read Only Memory)1103的系统存储器1104,以及连接系统存储器1104和中央处理单元1101的系统总线1105。服务器1100还包括帮助计算机内的各个器件之间传输信息的基本输入/输出系统(I/O系统,Input Output System)1106,和用于存储操作系统1113、应用程序1114和其他程序模块1115的大容量存储设备1107。The server 1100 includes a central processing unit (CPU, Central Processing Unit) 1101, a system memory 1104 including a random access memory (RAM, Random Access Memory) 1102 and a read only memory (ROM, Read Only Memory) 1103, and a connection system memory 1104 and the system bus 1105 of the central processing unit 1101 . The server 1100 also includes a basic input/output system (I/O system, Input Output System) 1106 that helps to transmit information between various devices in the computer, and a large computer for storing operating systems 1113, application programs 1114, and other program modules 1115. capacity storage device 1107 .

基本输入/输出系统1106包括有用于显示信息的显示器1108和用于用户输入信息的诸如鼠标、键盘之类的输入设备1109。其中显示器1108和输入设备1109都通过连接到系统总线1105的输入输出控制器1110连接到中央处理单元1101。基本输入/输出系统1106还可以包括输入输出控制器1110以用于接收和处理来自键盘、鼠标、或电子触控笔等多个其他设备的输入。类似地,输入输出控制器1110还提供输出到显示屏、打印机或其他类型的输出设备。The basic input/output system 1106 includes a display 1108 for displaying information and an input device 1109 such as a mouse and a keyboard for a user to input information. Both the display 1108 and the input device 1109 are connected to the central processing unit 1101 through the input and output controller 1110 connected to the system bus 1105 . The basic input/output system 1106 may also include an input output controller 1110 for receiving and processing input from a number of other devices such as a keyboard, mouse, or electronic stylus. Similarly, input output controller 1110 also provides output to a display screen, printer, or other type of output device.

大容量存储设备1107通过连接到系统总线1105的大容量存储控制器(未示出)连接到中央处理单元1101。大容量存储设备1107及其相关联的计算机可读介质为服务器1100提供非易失性存储。也就是说,大容量存储设备1107可以包括诸如硬盘或者紧凑型光盘只读存储器(CD-ROM,Compact Disc Read Only Memory)驱动器之类的计算机可读介质(未示出)。Mass storage device 1107 is connected to central processing unit 1101 through a mass storage controller (not shown) connected to system bus 1105 . Mass storage device 1107 and its associated computer-readable media provide non-volatile storage for server 1100 . That is, the mass storage device 1107 may include a computer-readable medium (not shown) such as a hard disk or a Compact Disc Read Only Memory (CD-ROM) drive.

不失一般性,计算机可读介质可以包括计算机存储介质和通信介质。计算机存储介质包括以用于存储诸如计算机可读指令、数据结构、程序模块或其他数据等信息的任何方法或技术实现的易失性和非易失性、可移动和不可移动介质。计算机存储介质包括RAM、ROM、可擦除可编程只读存储器(EPROM,Erasable Programmable Read Only Memory)、带电可擦可编程只读存储器(EEPROM,Electrically Erasable Programmable Read OnlyMemory)、闪存或其他固态存储其技术,CD-ROM、数字通用光盘(DVD,Digital VersatileDisc)或其他光学存储、磁带盒、磁带、磁盘存储或其他磁性存储设备。当然,本领域技术人员可知计算机存储介质不局限于上述几种。上述的系统存储器1104和大容量存储设备1107可以统称为存储器。Without loss of generality, computer-readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM, Erasable Programmable Read Only Memory), Electrically Erasable Programmable Read Only Memory (EEPROM, Electrically Erasable Programmable Read Only Memory), flash memory or other solid-state storage. technology, CD-ROM, Digital Versatile Disc (DVD, Digital Versatile Disc) or other optical storage, tape cartridge, magnetic tape, magnetic disk storage or other magnetic storage device. Certainly, those skilled in the art know that the computer storage medium is not limited to the above-mentioned ones. The above-mentioned system memory 1104 and mass storage device 1107 may be collectively referred to as memory.

根据本申请的各种实施例,服务器1100还可以通过诸如因特网等网络连接到网络上的远程计算机运行。也即服务器1100可以通过连接在系统总线1105上的网络接口单元1111连接到网络1112,或者说,也可以使用网络接口单元1111来连接到其他类型的网络或远程计算机系统(未示出)。According to various embodiments of the present application, the server 1100 can also run on a remote computer connected to the network through a network such as the Internet. That is to say, the server 1100 can be connected to the network 1112 through the network interface unit 1111 connected to the system bus 1105, or can use the network interface unit 1111 to connect to other types of networks or remote computer systems (not shown).

上述存储器还包括一个或者一个以上的程序,一个或者一个以上程序存储于存储器中,被配置由CPU执行。The above-mentioned memory also includes one or more programs, one or more programs are stored in the memory and configured to be executed by the CPU.

本申请的实施例还提供了一种计算机设备,该计算手机设备包括处理器和存储器,该存储器中存储有至少一条指令、至少一段程序、代码集或指令集,至少一条指令、至少一段程序、代码集或指令集由处理器加载并执行以实现上述各方法实施例提供的数据发送方法。The embodiment of the present application also provides a computer device, the computing mobile phone device includes a processor and a memory, at least one instruction, at least one section of program, code set or instruction set are stored in the memory, at least one instruction, at least one section of program, The code set or instruction set is loaded and executed by the processor to implement the data sending methods provided by the above method embodiments.

本申请的实施例还提供了一种计算机可读存储介质,该计算机可读存储介质上存储有至少一条指令、至少一段程序、代码集或指令集,至少一条指令、至少一段程序、代码集或指令集由处理器加载并执行,以实现上述各方法实施例提供的数据发送方法。Embodiments of the present application also provide a computer-readable storage medium, on which at least one instruction, at least one program, code set or instruction set is stored, at least one instruction, at least one program, code set or The instruction set is loaded and executed by the processor, so as to realize the data sending method provided by the above method embodiments.

可选地,该计算机可读存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、固态硬盘(SSD,Solid State Drives)或光盘等。其中,随机存取记忆体可以包括电阻式随机存取记忆体(ReRAM,Resistance RandomAccess Memory)和动态随机存取存储器(DRAM,Dynamic Random Access Memory)。上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。Optionally, the computer-readable storage medium may include: a read-only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), a solid-state hard drive (SSD, Solid State Drives) or an optical disc. Wherein, the random access memory may include a resistive random access memory (ReRAM, Resistance Random Access Memory) and a dynamic random access memory (DRAM, Dynamic Random Access Memory). The serial numbers of the above embodiments of the present application are for description only, and do not represent the advantages and disadvantages of the embodiments.

本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, and can also be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. The above-mentioned The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, and the like.

以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above are only optional embodiments of the application, and are not intended to limit the application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the application shall be included in the protection of the application. within range.

Claims (8)

1.一种数据发送方法,其特征在于,所述方法包括:1. A method for sending data, characterized in that the method comprises: 获取目标采集点生成的目标数据,所述目标数据为待上传至云端的数据;Obtain the target data generated by the target collection point, the target data is data to be uploaded to the cloud; 确定与所述目标采集点对应的数据发送方式,所述数据发送方式中包括定时发送方式,其中,所述定时发送方式表示定义双循环数组定时器对数据进行发送的方式,所述双循环数组定时器对应有游标指针,所述双循环数组定时器中包括第一定时数组和第二定时数组,所述第一定时数组以第一时间单位进行定时,所述第二定时数组以第二时间单位进行定时,所述第一时间单位的精度高于所述第二时间单位的精度,且所述第一定时数组和数组元素数量与所述第一时间单位的精度能够对应换算得到所述第二时间单位的精度;Determine the data sending method corresponding to the target collection point, the data sending method includes a timing sending method, wherein the timing sending method means defining a double-cycle array timer to send data, and the double-cycle array The timer corresponds to a cursor pointer. The double-cycle array timer includes a first timing array and a second timing array. The first timing array is timed by the first time unit, and the second timing array is timed by the second time The first time unit is used for timing, the precision of the first time unit is higher than the precision of the second time unit, and the first timing array and the number of array elements can be converted correspondingly to the precision of the first time unit to obtain the second the precision of two time units; 响应于所述目标采集点的发送时间间隔小于所述第二时间单位的精度,将所述目标采集点挂载至所述第一定时数组上;In response to the sending time interval of the target collection point being less than the accuracy of the second time unit, mount the target collection point on the first timing array; 响应于所述发送时间间隔大于岁数第二时间单位的精度,将所述目标采集点挂载至所述第二定时数组上;In response to the sending time interval being greater than the precision of the second time unit of age, mounting the target collection point on the second timing array; 以所述发送时间间隔对所述目标采集点在所述双循环数组定时器上的挂载位置进行更新;updating the mounting position of the target collection point on the double-cycle array timer at the sending time interval; 响应所述游标指针指向所述目标采集点所挂载的位置,将所述目标数据上传至所述云端。uploading the target data to the cloud in response to the cursor pointer pointing to the location where the target collection point is mounted. 2.根据权利要求1所述的方法,其特征在于,所述数据发送方式包括分段发送方式;2. The method according to claim 1, wherein the data transmission mode comprises a segmented transmission mode; 以所述数据发送方式将所述目标数据上传至所述云端,包括:Uploading the target data to the cloud in the data sending manner includes: 确定所述目标采集点的发送时间间隔以及当前时间点;Determine the sending time interval and the current time point of the target collection point; 结合所述当前时间点与所述发送时间间隔,确定所述目标采集点对应的目标时间片;Combining the current time point and the sending time interval, determine a target time slice corresponding to the target collection point; 在所述目标时间片将所述目标数据上传至所述云端。uploading the target data to the cloud in the target time slice. 3.根据权利要求2所述的方法,其特征在于,所述在所述目标时间片将所述目标数据上传至所述云端,包括:3. The method according to claim 2, wherein uploading the target data to the cloud in the target time slice comprises: 响应于所述目标时间片内未发送过数据,在所述目标时间片将所述目标数据上传至所述云端。Uploading the target data to the cloud in the target time slot in response to no data being sent within the target time slot. 4.根据权利要求1所述的方法,其特征在于,所述目标采集点挂载在所述第一定时数组上;4. The method according to claim 1, wherein the target collection point is mounted on the first timing array; 所述以所述发送时间间隔对所述目标采集点在所述双循环数组定时器上的挂载位置进行更新,包括:The updating of the mounting position of the target collection point on the double-cycle array timer at the sending time interval includes: 确定所述目标采集点在所述第一定时数组上当前挂载的第一位置点;determining the first position point currently mounted on the first timing array of the target collection point; 在所述第一定时数组中循环确定所述第一位置点移动与所述发送时间间隔对应长度后的第二位置点;In the first timing array, cyclically determine a second position point after the first position point has moved to a length corresponding to the sending time interval; 将所述目标采集点挂载至所述第二位置点。Mount the target collection point to the second location point. 5.根据权利要求1所述的方法,其特征在于,所述目标采集点挂载在所述第二定时数组上,所述游标指针包括第一指针和第二指针,所述第一指针与所述第一定时数组对应,所述第二指针与所述第二定时数组对应;5. The method according to claim 1, wherein the target collection point is mounted on the second timing array, the cursor pointer comprises a first pointer and a second pointer, and the first pointer and The first timing array corresponds, and the second pointer corresponds to the second timing array; 所述响应于所述游标指针指向所述目标采集点所挂载的位置,将所述目标数据上传至所述云端,包括:The uploading the target data to the cloud in response to the cursor pointer pointing to the mounted position of the target collection point includes: 响应于所述第二指针指向所述目标采集点在所述第二定时数组上挂载的第三位置,结合所述发送时间间隔将所述目标采集点移动至所述第一定时数组的第四位置处;In response to the second pointer pointing to the third position of the target collection point mounted on the second timing array, moving the target collection point to the first timing array in combination with the sending time interval four positions; 响应于所述第一指针指向所述第一定时数组中的所述第四位置处,将所述目标数据上传至所述云端。Uploading the target data to the cloud in response to the first pointer pointing to the fourth position in the first timing array. 6.一种数据发送装置,其特征在于,所述装置包括:6. A data sending device, characterized in that the device comprises: 获取模块,用于获取目标采集点生成的目标数据,所述目标数据为待上传至云端的数据;The obtaining module is used to obtain the target data generated by the target collection point, and the target data is data to be uploaded to the cloud; 确定模块,用于确定与所述目标采集点对应的数据发送方式,所述数据发送方式中包括定时发送方式,其中,所述定时发送方式表示定义双循环数组定时器对数据进行发送的方式,所述双循环数组定时器对应有游标指针,所述双循环数组定时器中包括第一定时数组和第二定时数组,所述第一定时数组以第一时间单位进行定时,所述第二定时数组以第二时间单位进行定时,所述第一时间单位的精度高于所述第二时间单位的精度,且所述第一定时数组和数组元素数量与所述第一时间单位的精度能够对应换算得到所述第二时间单位的精度;A determination module, configured to determine a data transmission mode corresponding to the target collection point, wherein the data transmission mode includes a timing transmission mode, wherein the timing transmission mode represents a mode in which a double-cycle array timer is defined to send data, The double-cycle array timer corresponds to a cursor pointer, and the double-cycle array timer includes a first timing array and a second timing array, the first timing array is used for timing in the first time unit, and the second timing array is The array is timed with a second time unit, the precision of the first time unit is higher than the precision of the second time unit, and the first timing array and the number of array elements can correspond to the precision of the first time unit Conversion to obtain the accuracy of the second time unit; 挂载模块,用于响应于所述目标采集点的发送时间间隔小于所述第二时间单位的精度,将所述目标采集点挂载至所述第一定时数组上;响应于所述发送时间间隔大于岁数第二时间单位的精度,将所述目标采集点挂载至所述第二定时数组上;A mounting module, configured to mount the target collection point on the first timing array in response to the sending time interval of the target collection point being less than the accuracy of the second time unit; in response to the sending time The interval is greater than the accuracy of the second time unit of age, and the target collection point is mounted on the second timing array; 所述挂载模块,还用于以所述发送时间间隔对所述目标采集点在所述双循环数组定时器上的挂载位置进行更新;The mounting module is further configured to update the mounting position of the target collection point on the double-cycle array timer at the sending time interval; 发送模块,用于响应所述游标指针指向所述目标采集点所挂载的位置,将所述目标数据上传至所述云端。A sending module, configured to upload the target data to the cloud in response to the cursor pointing to the location where the target collection point is mounted. 7.一种计算机设备,其特征在于,所述计算机设备包括处理器和存储器,所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如权利要求1至5任一所述的数据发送方法。7. A computer device, characterized in that the computer device includes a processor and a memory, at least one instruction, at least one section of program, code set or instruction set are stored in the memory, the at least one instruction, the at least A program, the code set or instruction set is loaded and executed by the processor to implement the data sending method according to any one of claims 1-5. 8.一种计算机可读存储介质,其特征在于,所述存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由处理器加载并执行以实现如权利要求1至5任一所述的数据发送方法。8. A computer-readable storage medium, characterized in that at least one instruction, at least one section of program, code set or instruction set is stored in the storage medium, and the at least one instruction, the at least one section of program, the code The set or instruction set is loaded and executed by the processor to implement the data sending method as claimed in any one of claims 1 to 5.
CN202010152040.3A 2020-03-06 2020-03-06 Data transmission method, device, device and readable storage medium Expired - Fee Related CN111556087B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010152040.3A CN111556087B (en) 2020-03-06 2020-03-06 Data transmission method, device, device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010152040.3A CN111556087B (en) 2020-03-06 2020-03-06 Data transmission method, device, device and readable storage medium

Publications (2)

Publication Number Publication Date
CN111556087A CN111556087A (en) 2020-08-18
CN111556087B true CN111556087B (en) 2023-02-28

Family

ID=72004163

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010152040.3A Expired - Fee Related CN111556087B (en) 2020-03-06 2020-03-06 Data transmission method, device, device and readable storage medium

Country Status (1)

Country Link
CN (1) CN111556087B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202632084U (en) * 2012-06-11 2012-12-26 山东中创软件工程股份有限公司 Shipborne dangerous cargo monitoring system
CA2755230A1 (en) * 2011-10-14 2013-04-14 Bluetick, Inc. System and method to monitor and control remote sensors and equipment
CN103473071A (en) * 2013-09-24 2013-12-25 深圳市路通网络技术有限公司 Realizing method and system of software timers
CN104035786A (en) * 2014-07-01 2014-09-10 上海斐讯数据通信技术有限公司 Optimization method and system of software timers
CN104483949A (en) * 2014-12-16 2015-04-01 大连久鹏电子系统工程有限公司 Remote monitoring system for small distributed environment-friendly equipment
CN110035055A (en) * 2019-02-19 2019-07-19 中国铁建重工集团股份有限公司 Industrial equipment remote data acquisition and processing method and transmission method
CN110535965A (en) * 2019-09-03 2019-12-03 北京元安物联技术有限公司 A kind of data processing method and device, storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8250088B2 (en) * 2007-10-05 2012-08-21 Imation Corp. Methods for controlling remote archiving systems

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2755230A1 (en) * 2011-10-14 2013-04-14 Bluetick, Inc. System and method to monitor and control remote sensors and equipment
CN202632084U (en) * 2012-06-11 2012-12-26 山东中创软件工程股份有限公司 Shipborne dangerous cargo monitoring system
CN103473071A (en) * 2013-09-24 2013-12-25 深圳市路通网络技术有限公司 Realizing method and system of software timers
CN104035786A (en) * 2014-07-01 2014-09-10 上海斐讯数据通信技术有限公司 Optimization method and system of software timers
CN104483949A (en) * 2014-12-16 2015-04-01 大连久鹏电子系统工程有限公司 Remote monitoring system for small distributed environment-friendly equipment
CN110035055A (en) * 2019-02-19 2019-07-19 中国铁建重工集团股份有限公司 Industrial equipment remote data acquisition and processing method and transmission method
CN110535965A (en) * 2019-09-03 2019-12-03 北京元安物联技术有限公司 A kind of data processing method and device, storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李艳红.一种应用于UDP网络通讯状态机的智能定时器的软件实现.《 中南民族大学学报(自然科学版)》.2013, *

Also Published As

Publication number Publication date
CN111556087A (en) 2020-08-18

Similar Documents

Publication Publication Date Title
KR102476531B1 (en) Data Synchronization Method and Apparatus, Media, and Electronic Device for Distributed Systems
CN109074377B (en) Managed function execution for real-time processing of data streams
CN110795499B (en) Cluster data synchronization method, device, equipment and storage medium based on big data
US11733885B2 (en) Transferring computational operations to controllers of data storage devices
CN110413588B (en) Distributed object storage method and device, computer equipment and storage medium
CN116896512B (en) Cloud edge cooperative system evaluation method and device, storage medium and electronic equipment
WO2019109352A1 (en) Method and device for sampling performance data of apparatus
CN108846114A (en) Distributed system control method, device, equipment and readable storage medium storing program for executing
US20240220334A1 (en) Data processing method in distributed system, and related system
CN116776953A (en) A model compression deployment method, device, server and storage medium
CN102282545B (en) Storage system
CN115987965A (en) File uploading method, device, equipment and storage medium
CN107797758B (en) Date storage method, data access method and device
CN105045873A (en) Data file pushing method, apparatus and system
CN114064308B (en) Multi-data sending and receiving method, device and equipment based on column data scanning
CN111556087B (en) Data transmission method, device, device and readable storage medium
CN113704374B (en) Spacecraft trajectory fitting method, device and terminal
CN118861004A (en) Data migration method, device, allocation node, system, medium and program product
CN112306406A (en) Intelligent storage automatic grading method and device, storage medium and electronic equipment
CN116974469A (en) Data scheduling method and device, storage medium and electronic equipment
CN114610760B (en) Data processing method, device, electronic device and computer readable storage medium
CN116594568A (en) Data storage method and device, electronic equipment and storage medium
WO2021218626A1 (en) Data storage method and apparatus, device, and storage medium
CN116028446A (en) Time sequence data file management method, device, equipment and storage medium thereof
CN113992598A (en) Method and device for uploading streaming data, access equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20230228

CF01 Termination of patent right due to non-payment of annual fee