Data processing method and device, equipment, storage medium and program product
By electing the master device in the terminal device group, summarizing and reporting data, the problem of excessive computing pressure on the server is solved, and the resource requirements and operating costs of the server are reduced.
Patent Information
- Application Number
- CN202410241399.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-04
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-03-04
AI Technical Summary
In the existing technology, data reporting by terminal devices causes excessive computing pressure on the server, leading to an increase in server operating costs.
By electing the master device in the terminal device group, the indicator data of each follower device is collected and summarized, and the master device reports the summarized data to the server, reducing the data aggregation requirements of the server.
It reduces the memory and processor requirements of the server, reduces the computing power requirements of the server, and reduces the number of requests from the terminal device to the server.
Smart Images

Figure CN118803014A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computing network technology, and in particular, relates to a data processing method, device, equipment, storage medium and program product. Background Art
[0002] Nowadays, there are more and more terminal devices such as computers and mobile phones. The management of terminal devices is generally achieved by the terminal devices directly reporting to the server through a specific communication protocol. The terminal devices need to report all information to the server, including traffic, freezes, etc., and the server will then summarize the data.
[0003] Since all data needs to be summarized and aggregated on the server side, the server side is under great computing pressure. As the number of terminal devices continues to increase, the amount of information reported increases, and the accuracy of reporting improves, the number of visits to the server gradually increases, which means that the demand for server computing power such as memory and processor increases, resulting in a sharp increase in server operating costs. Summary of the invention
[0004] The embodiments of the present application provide a data processing method, apparatus, device, storage medium and program product, which can solve the existing problem of excessively high computing power requirements for servers.
[0005] In a first aspect, an embodiment of the present application provides a data processing method, the method comprising:
[0006] Receiving, by a first master device, indicator data of N first follower devices, wherein the first device group includes a plurality of first devices, the first device includes the first master device and P first follower devices, wherein N is a positive integer, P is a positive integer greater than or equal to N, and the P first follower devices include the N first follower devices;
[0007] When N is greater than or equal to a first quantity threshold, the first master device aggregates the indicator data of the N first follower devices and the indicator data of the first master device to obtain aggregated data;
[0008] The summary data is sent to the service end through the first master device.
[0009] In some embodiments, before receiving the indicator data of the N first follower devices through the first master device, the method further includes:
[0010] Obtaining an actual timeout interval of each first device in the first device group;
[0011] In the case where the second device does not generate a heartbeat signal or does not receive a heartbeat signal sent by the first master device within a first time threshold after a first moment, determining the second device as a candidate device, wherein the second device is any first device in the first device group, the first moment is the moment of most recently generating or receiving a heartbeat signal, and the first time threshold is any time in an actual timeout interval of the second device;
[0012] The first master device is determined from among the plurality of candidate devices based on an actual timeout interval of each of the candidate devices in the first device group.
[0013] In some embodiments, obtaining an actual timeout interval of each first device in the first device group includes:
[0014] Obtaining a preset original timeout interval, wherein the original timeout interval includes an original timeout interval minimum value and an original timeout interval maximum value;
[0015] Obtaining a device score of a third device, wherein the third device is any one of the plurality of first devices in the first device group;
[0016] Determine the actual maximum timeout interval value of the third device according to the device score and the original maximum timeout interval value;
[0017] An actual timeout interval of the third device is generated based on the original timeout interval minimum value and the actual timeout interval maximum value.
[0018] In some embodiments, obtaining a device rating of the third device includes:
[0019] Acquire multiple device parameters of the third device and a weight coefficient corresponding to each device parameter, wherein the device parameters include online duration, available memory, available storage space, and number of available processor cores within a first time range;
[0020] The sum of the products of each of the device parameters and the weight coefficients corresponding to the device parameters is determined as the device score of the third device.
[0021] In some embodiments, sending the summary data to the server through the first master device includes:
[0022] In the case where data in the first device group requires strong consistency, writing the summary data into a log file of the first master device;
[0023] Sending the summary data to each first follower device in the first device group;
[0024] When the number of response messages received by the first master device is greater than a second number threshold, the summary data is sent to the service end, and the response message is used to respond to receiving the summary data sent by the first master device.
[0025] In some embodiments, before receiving the indicator data of the N first follower devices through the first master device, the method further includes:
[0026] Sending the network identification, grouping status and device score of the fourth device to the server through a fourth device, wherein the fourth device is any device terminal that is communicatively connected to the server;
[0027] When the grouping state of the fourth device is ungrouped, receiving grouping information generated by the server based on the network identifier and the device score;
[0028] A device group to which the fourth device belongs is determined based on the grouping information, where the device group includes the first device group.
[0029] In a second aspect, an embodiment of the present application provides a data processing device, the device comprising:
[0030] a receiving module, configured to receive indicator data of N first follower devices through a first master device, wherein the first device group includes a plurality of first devices, the first device includes the first master device and P first follower devices, wherein N is a positive integer, P is a positive integer greater than or equal to N, and the P first follower devices include the N first follower devices;
[0031] a summarizing module, configured to, when N is greater than or equal to a first quantity threshold, aggregate the indicator data of the N first follower devices and the indicator data of the first master device through the first master device to obtain aggregated data;
[0032] A sending module is used to send the summary data to the service end through the first main device.
[0033] In a third aspect, an embodiment of the present application provides a data processing device, the device comprising: a processor and a memory storing computer program instructions;
[0034] The above data processing method is implemented when the processor executes computer program instructions.
[0035] In a fourth aspect, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above data processing method is implemented.
[0036] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes computer program instructions, and the computer program instructions implement the above data processing method when executed by a processor.
[0037] In this application, the master device in the device group collects the indicator data of each follower device in the device group, summarizes the indicator data, obtains the summary data, and then the master device reports the summary data to the server. In this way, compared with the prior art, a device group only needs to make a data reporting request to the server once, and the server does not need to aggregate the collected indicator data, which not only reduces the number of requests from the terminal device to the server, but also reduces the memory and processor requirements of the server, and reduces the computing power requirements of the server. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application 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 creative work.
[0039] Figure 1 It is a flowchart of a data processing method provided by an embodiment of the present application;
[0040] Figure 2 is a structural diagram of a data processing device provided by an embodiment of the present application;
[0041] Figure 3 It is a schematic diagram of the hardware structure of a data processing device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0042] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0043] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0044] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The embodiments will be described in detail below in conjunction with the accompanying drawings.
[0045] Specifically, in order to solve the problems of the prior art, the embodiments of the present application provide a data processing method, device, equipment, storage medium and program product. The data processing method provided by the embodiments of the present application is first introduced below.
[0046] Figure 1 A flow chart of a data processing method provided by an embodiment of the present application is shown. The method is applied to a first device group, and the method includes the following steps:
[0047] S110, receiving indicator data of N first follower devices through a first master device, wherein the first device group includes multiple first devices, the first device includes the first master device and P first follower devices, wherein N is a positive integer, P is a positive integer greater than or equal to N, and the P first follower devices include the N first follower devices.
[0048] In this embodiment, in order to achieve unified status management and resource management of the terminal device, the terminal device needs to maintain a communication connection with the server and report its own indicator data to the server. The indicator data is used to represent the operating status of the terminal device itself and other information, such as the flow rate and freeze of the terminal device.
[0049] Before a terminal device reports its own indicator data, multiple terminal devices that have communication connections with the same server can be divided into different device groups according to pre-set grouping rules. Each device group includes at least two terminal devices, and each device group is autonomous in a decentralized manner.
[0050] Specifically, taking the first device group as an example, the first device group includes multiple first devices, and the first devices may include a first master device and P first follower devices. Among them, the first master device may play a leading role in the device group. Before the first device group reports data, N of the P first follower devices will send their own indicator data to the first master device, and the first master device can receive N copies of the indicator data.
[0051] S120: When N is greater than or equal to a first quantity threshold, the first master device aggregates the indicator data of the N first follower devices and the indicator data of the first master device to obtain aggregated data.
[0052] In this embodiment, after receiving N indicator data from N first follower devices, the first master device compares the number N of received indicator data with a pre-set first number threshold. If N is less than the first number threshold, it can be considered that the amount of data received by the first master device is too small, that is, the N received indicator data are discarded; if N is greater than or equal to the first number threshold, it can be considered that the amount of data received by the first master device meets the reporting standard, and the N indicator data and the indicator data of the first master device itself can be aggregated to obtain summary data.
[0053] S130: Send the summary data to a server through the first master device.
[0054] In this embodiment, after aggregating the N+1 pieces of indicator data, the first master device may report the indicator data in the first device group to the server in the form of aggregated data.
[0055] Take the indicator data as device traffic as an example, N is 4, so the summarized indicator data is 5 copies. The 5 copies of data before summary are shown in Table 1:
[0056]
[0057] Table 1: The data reported by each first device is summarized as shown in Table 2:
[0058]
[0059] Table 2: Summary data
[0060] In this way, the amount of the aggregated data is greatly reduced, thereby greatly reducing the amount of data that needs to be reported in the first device group.
[0061] In this application, the master device in the device group collects the indicator data of each follower device in the device group, summarizes the indicator data, and then reports the summary data to the server. In this way, compared with the prior art, a device group only needs to make a data reporting request to the server once, and the server does not need to aggregate the collected indicator data, which not only reduces the number of requests from the terminal device to the server, but also reduces the memory and processor requirements of the server, and reduces the computing power requirements of the server. .
[0062] As an optional embodiment, before receiving the indicator data of the N first follower devices through the first master device, the method further includes:
[0063] Obtaining an actual timeout interval of each first device in the first device group;
[0064] In the case where the second device does not generate a heartbeat signal or does not receive a heartbeat signal sent by the first master device within a first time threshold after a first moment, determining the second device as a candidate device, wherein the second device is any first device in the first device group, the first moment is the moment of most recently generating or receiving a heartbeat signal, and the first time threshold is any time in an actual timeout interval of the second device;
[0065] The first master device is determined from among the plurality of candidate devices based on an actual timeout interval of each of the candidate devices in the first device group.
[0066] In this embodiment, if there is a first master device in the first device group, the first master device will generate a heartbeat signal at intervals and send the heartbeat signal to each first follower device in the first device group. The heartbeat signal can be used to indicate the state of the first master device and maintain the dominant position of the first master device in the first device group.
[0067] If after the first moment, within the first time threshold, no heartbeat signal is generated or received in the second device, it can be considered that the first master device in the first device group where the second device is located has failed or is unavailable, and it is necessary to re-elect the first master device from among the multiple first devices.
[0068] Specifically, the Raft distributed consensus algorithm can be used to implement the election of the first master device. Before the election, each terminal device is assigned a device score, which can be evaluated based on the performance, reliability or other relevant factors of the device. The actual timeout interval of each first device can be determined based on the device score. If the second device does not generate or receive a heartbeat signal, the second device may initiate an election at any time point within the actual timeout interval, that is, convert its own state to a candidate state and become a candidate device.
[0069] Then, one of the multiple candidate devices in the first device group may be selected to become a new first master device. For example, the candidate device that initiates the election earliest among the multiple candidate devices may be determined as the first master device.
[0070] In this way, the first device with a higher device score is more likely to trigger the election process earlier in the election and has a better chance of becoming the new first master device.
[0071] As an optional embodiment, obtaining an actual timeout interval of each first device in the first device group includes:
[0072] Obtaining a preset original timeout interval, wherein the original timeout interval includes an original timeout interval minimum value and an original timeout interval maximum value;
[0073] Obtaining a device score of a third device, wherein the third device is any one of the plurality of first devices in the first device group;
[0074] Determine the actual maximum timeout interval value of the third device according to the device score and the original maximum timeout interval value;
[0075] An actual timeout interval of the third device is generated based on the original timeout interval minimum value and the actual timeout interval maximum value.
[0076] In this embodiment, a unified original timeout interval [left1, right1] may be set for each first device in the first device group, the minimum value of the original timeout interval is left1, and the maximum value of the original timeout interval is right1.
[0077] Then, taking the third device as an example, its device score is determined based on factors such as the current performance and reliability of the third device, and the actual timeout interval maximum value right2 is further calculated based on the device score of the third device and the original timeout interval maximum value, and then the actual timeout interval [left1, right2] of the third device is generated based on the original timeout interval minimum value left1 and the actual timeout interval maximum value right2.
[0078] For example, the actual timeout interval maximum value right2 may be further calculated based on the device score of the third device and the original timeout interval maximum value by using the first calculation formula.
[0079] The first calculation formula is:
[0080] right2=right1-(right1-left1)X score / 100
[0081] Among them, right2 is the actual maximum value of the timeout interval, right1 is the original maximum value of the timeout interval, left1 is the original minimum value of the timeout interval, and score is the device score.
[0082] Through the above method for determining the actual timeout interval, a terminal device with a high device score can be more likely to be elected as a new first master device, so that a terminal device with better performance can become the master device, thereby improving the stability of data aggregation and data reporting.
[0083] As an optional embodiment, obtaining the device score of the third device includes:
[0084] Acquire multiple device parameters of the third device and a weight coefficient corresponding to each device parameter, wherein the device parameters include online duration, available memory, available storage space, and number of available processor cores within a first time range;
[0085] The sum of the products of each of the device parameters and the weight coefficients corresponding to the device parameters is determined as the device score of the third device.
[0086] In this embodiment, the device score of the terminal device can be calculated by the device parameters of each terminal device and the weight coefficient corresponding to each device parameter. The device parameters can include online time, available memory, available storage space, and available processor core number within the first time range.
[0087] For example, the first time range may be one week before the current time, the weight coefficient corresponding to the online time in the first time range may be 0.5, the weight coefficient corresponding to the available memory may be 0.2, the weight coefficient corresponding to the available storage space may be 0.1, and the weight coefficient corresponding to the number of available processor cores may be 0.2. The online time is 168 hours (7 days) as the full score, the available memory is 1G as the full score, the available CPU core is 1 as the full score, and the available storage is 1G as the full score, and the full score is set to 100 points.
[0088] If the online time of the third device in the first time range is 84 hours, the available memory is 1G, the available CPU core number is 1, and the available storage is 1G, then the device score of the third device is 75 points.
[0089] The device score obtained through the above calculation method can more accurately represent the current performance and available computing power of the terminal device.
[0090] As an optional embodiment, sending the summary data to the server through the first master device includes:
[0091] In the case where data in the first device group requires strong consistency, writing the summary data into a log file of the first master device;
[0092] Sending the summary data to each first follower device in the first device group;
[0093] When the number of response messages received by the first master device is greater than a second number threshold, the summary data is sent to the service end, and the response message is used to respond to receiving the summary data sent by the first master device.
[0094] In this embodiment, when the data of multiple first devices in the first device group require strong consistency, it means that it is necessary to ensure that the data on most devices in the first device group are the same and consistent at any time.
[0095] If the data in the first device group requires strong consistency, then after the first master device completes the aggregation of the indicator data and generates the aggregated data, the first master device can generate its own sequence number and term, and write the sequence number, term and aggregated data into the log file of the first master device. The sequence number is used to indicate the first master device in the first target group, and the term is used to indicate the duration of the successive masters.
[0096] In addition, in order to ensure strong consistency of data, the first master device can also send the summary data to the first follower device that is communicatively connected to it. If the first follower device receives the summary data, it will write the summary data into its log file and feedback a response message to the first master device. The response message is used to notify the first master device of its receipt of the summary data.
[0097] Then, each time the first master device receives a response message, it means that a first follower device has synchronized a copy of the summary data. Therefore, the first master device can compare the number of received response messages with a preset second number threshold.
[0098] If the number of response messages is greater than the second number threshold, it can be considered that most of the first follower devices have completed data synchronization with the first master device, and the first device group meets the strong consistency requirement, then the first master device can send the summary data to the server. If the number of response messages is less than or equal to the second number threshold, it can be considered that the first device group does not meet the strong consistency requirement, and the first master device does not send the summary data to the server.
[0099] In addition, after completing data synchronization and the first master device reports the data, the first master device can submit the summary data locally and record the latest summary data in its own status file. Then the first master device notifies all first follower devices to submit data, and all first follower devices can also record the latest summary data in their own status files.
[0100] Through the above method, the consistency of data in the device group can be guaranteed.
[0101] As an optional embodiment, before receiving the indicator data of the N first follower devices through the first master device, the method further includes:
[0102] Sending the network identification, grouping status and device score of the fourth device to the server through a fourth device, wherein the fourth device is any device terminal that is communicatively connected to the server;
[0103] When the grouping state of the fourth device is ungrouped, receiving grouping information generated by the server based on the network identifier and the device score;
[0104] A device group to which the fourth device belongs is determined based on the grouping information, where the device group includes the first device group.
[0105] In this embodiment, the service terminal connected to the same server needs to send its network identification, grouping status and device score to the server. The network identification may include the fourth device's own IP address (Internet Protocol Address), port number and NAT (Network Address Translation) type. The grouping status is used to indicate whether the fourth device is grouped.
[0106] After the fourth device sends the network identification, grouping status and device score to the server, the server can group all terminal devices whose grouping status is ungrouped based on the received information and the pre-set grouping rules, and then generate grouping information based on the grouping results, and push the grouping information to each terminal device. After each terminal device receives the grouping information from the server, it can determine the group to which it belongs according to the grouping information.
[0107] For example, the grouping rule may be that the number of terminal devices included in each device group is an odd number greater than 3, and the physical distance between any two terminal devices in the same device group must be less than a preset distance threshold. In addition, more than a certain proportion of the terminal devices in each device group must have a device score greater than a score threshold.
[0108] In this way, the grouping of devices can be completed relatively quickly.
[0109] Based on the data processing method provided in the above embodiment, the present application also provides a specific implementation of a data processing device. Please refer to the following embodiment.
[0110] See first Figure 2 The data processing device 200 provided in the embodiment of the present application includes the following modules:
[0111] The receiving module 201 is configured to receive indicator data of N first follower devices through a first master device, wherein the first device group includes a plurality of first devices, the first device includes the first master device and P first follower devices, wherein N is a positive integer, P is a positive integer greater than or equal to N, and the P first follower devices include the N first follower devices;
[0112] A summarizing module 202, configured to, when N is greater than or equal to a first quantity threshold, aggregate the indicator data of the N first follower devices and the indicator data of the first master device through the first master device to obtain aggregated data;
[0113] The sending module 203 is used to send the summary data to the server through the first master device.
[0114] The device can collect the indicator data of each follower device in the device group through the master device in the device group, and summarize the indicator data to obtain the summary data, and then the master device reports the summary data to the server. In this way, compared with the existing technology, a device group only needs to make a data reporting request to the server once, and the server does not need to aggregate the collected indicator data, which not only reduces the number of requests from the terminal device to the server, but also reduces the memory and processor requirements of the server, and reduces the computing power requirements of the server.
[0115] As an implementation of the present application, the data processing device 200 may further include:
[0116] An acquisition module, configured to acquire an actual timeout interval of each first device in the first device group;
[0117] A candidate module, configured to determine the second device as a candidate device if the second device does not generate a heartbeat signal or does not receive a heartbeat signal sent by the first master device within a first time threshold after a first moment, wherein the second device is any first device in the first device group, the first moment is the moment when a heartbeat signal is most recently generated or received, and the first time threshold is any time in an actual timeout interval of the second device;
[0118] The election module is configured to determine the first master device from among a plurality of the candidate devices based on an actual timeout interval of each of the candidate devices in the first device group.
[0119] As an implementation of the present application, the acquisition module may further include:
[0120] A first acquisition unit, configured to acquire a preset original timeout interval, wherein the original timeout interval includes an original timeout interval minimum value and an original timeout interval maximum value;
[0121] A second acquiring unit, configured to acquire a device score of a third device, wherein the third device is any one of the plurality of first devices in the first device group;
[0122] A first determining unit, configured to determine an actual maximum timeout interval value of the third device according to the device score and the original maximum timeout interval value;
[0123] A generating unit is configured to generate an actual timeout interval of the third device based on the original minimum timeout interval value and the actual maximum timeout interval value.
[0124] As an implementation of the present application, the second acquisition unit may further include:
[0125] an acquisition subunit, configured to acquire a plurality of device parameters of the third device and a weight coefficient corresponding to each device parameter, wherein the device parameters include an online duration, available memory, available storage space, and a number of available processor cores within a first time range;
[0126] The scoring subunit is used to determine the sum of the products of each of the device parameters and the weight coefficients corresponding to the device parameters as the device score of the third device.
[0127] As an implementation of the present application, the sending module 203 may further include:
[0128] a writing unit, configured to write the summary data into a log file of the first master device when strong consistency is required for data in the first device group;
[0129] A first sending unit, configured to send the summary data to each first following device in the first device group;
[0130] The second sending unit is used to send the summary data to the server when the number of response messages received by the first master device is greater than a second number threshold, and the response message is used to respond to receiving the summary data sent by the first master device.
[0131] As an implementation of the present application, the data processing device 200 may also be used to:
[0132] Sending the network identification, grouping status and device score of the fourth device to the server through a fourth device, wherein the fourth device is any device terminal that is communicatively connected to the server;
[0133] When the grouping state of the fourth device is ungrouped, receiving grouping information generated by the server based on the network identifier and the device score;
[0134] A device group to which the fourth device belongs is determined based on the grouping information, where the device group includes the first device group.
[0135] The data processing device provided in the embodiment of the present invention can implement each step in the above method embodiment, and will not be described again here to avoid repetition.
[0136] Figure 3 A schematic diagram of the hardware structure of a data processing device provided in an embodiment of the present application is shown.
[0137] The data processing device may include a processor 301 and a memory 302 storing computer program instructions.
[0138] Specifically, the processor 301 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0139] The memory 302 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 302 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 302 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 302 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 302 is a non-volatile solid-state memory.
[0140] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0141] The processor 301 implements any one of the data processing methods in the above embodiments by reading and executing computer program instructions stored in the memory 302 .
[0142] In one example, the data processing device may further include a communication interface 303 and a bus 310. Figure 3 As shown, the processor 301, the memory 302, and the communication interface 303 are connected via a bus 310 and communicate with each other.
[0143] The communication interface 303 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0144] Bus 310 includes hardware, software or both, and the parts of data processing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 310 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0145] The data processing device may be based on the above embodiments, thereby realizing the data processing method and apparatus combined with the above embodiments.
[0146] In addition, in combination with the data processing method in the above embodiment, the embodiment of the present application may provide a computer storage medium to implement. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the data processing methods in the above embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here. Among them, the above-mentioned computer-readable storage medium may include a non-transitory computer-readable storage medium, such as a read-only memory (Read-Only Memory, referred to as ROM), a random access memory (Random Access Memory, referred to as RAM), a disk or an optical disk, etc., which is not limited here.
[0147] In addition, an embodiment of the present application further provides a computer program product, including computer program instructions, which can implement the steps and corresponding contents of the aforementioned method embodiment when the computer program instructions are executed by a processor.
[0148] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0149] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0150] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0151] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0152] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A data processing method, It is characterized in that The method is applied to a first device group, and the method includes: Receiving, by a first master device, indicator data of N first follower devices, wherein the first device group includes a plurality of first devices, the first device includes the first master device and P first follower devices, wherein N is a positive integer, P is a positive integer greater than or equal to N, and the P first follower devices include the N first follower devices; When N is greater than or equal to a first quantity threshold, the first master device aggregates the indicator data of the N first follower devices and the indicator data of the first master device to obtain aggregated data; The summary data is sent to the service end through the first master device.
2. The data processing method according to claim 1, It is characterized in that Before receiving the indicator data of the N first follower devices through the first master device, the method further includes: Obtaining an actual timeout interval of each first device in the first device group; In the case where the second device does not generate a heartbeat signal or does not receive a heartbeat signal sent by the first master device within a first time threshold after a first moment, determining the second device as a candidate device, wherein the second device is any first device in the first device group, the first moment is the moment of most recently generating or receiving a heartbeat signal, and the first time threshold is any time in an actual timeout interval of the second device; The first master device is determined from among the plurality of candidate devices based on an actual timeout interval of each of the candidate devices in the first device group.
3. The data processing method according to claim 2, It is characterized in that The obtaining of the actual timeout interval of each first device in the first device group includes: Obtaining a preset original timeout interval, wherein the original timeout interval includes an original timeout interval minimum value and an original timeout interval maximum value; Obtaining a device score of a third device, wherein the third device is any one of the plurality of first devices in the first device group; Determine the actual maximum timeout interval value of the third device according to the device score and the original maximum timeout interval value; An actual timeout interval of the third device is generated based on the original timeout interval minimum value and the actual timeout interval maximum value.
4. The data processing method according to claim 3, It is characterized in that The obtaining of the device rating of the third device includes: Acquire multiple device parameters of the third device and a weight coefficient corresponding to each device parameter, wherein the device parameters include online duration, available memory, available storage space, and number of available processor cores within a first time range; The sum of the products of each of the device parameters and the weight coefficients corresponding to the device parameters is determined as the device score of the third device.
5. The data processing method according to claim 1, It is characterized in that The sending the summary data to the server through the first master device includes: In the case where data in the first device group requires strong consistency, writing the summary data into a log file of the first master device; Sending the summary data to each first follower device in the first device group; When the number of response messages received by the first master device is greater than a second number threshold, the summary data is sent to the service end, and the response message is used to respond to receiving the summary data sent by the first master device.
6. The data processing method according to claim 1, It is characterized in that Before receiving the indicator data of the N first follower devices through the first master device, the method further includes: Sending the network identification, grouping status and device score of the fourth device to the server through a fourth device, wherein the fourth device is any device terminal that is communicatively connected to the server; When the grouping state of the fourth device is ungrouped, receiving grouping information generated by the server based on the network identifier and the device score; A device group to which the fourth device belongs is determined based on the grouping information, where the device group includes the first device group.
7. A data processing device, It is characterized in that The device comprises: a receiving module, configured to receive indicator data of N first follower devices through a first master device, wherein the first device group includes a plurality of first devices, the first device includes the first master device and P first follower devices, wherein N is a positive integer, P is a positive integer greater than or equal to N, and the P first follower devices include the N first follower devices; a summarizing module, configured to, when N is greater than or equal to a first quantity threshold, aggregate the indicator data of the N first follower devices and the indicator data of the first master device through the first master device to obtain aggregated data; A sending module is used to send the summary data to the service end through the first main device.
8. A data processing device, It is characterized in that The data processing device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the data processing method according to any one of claims 1 to 6 is implemented.
9. A computer storage medium, It is characterized in that The computer storage medium stores computer program instructions, which, when executed by a processor, implement the data processing method according to any one of claims 1 to 6.
10. A computer program product, It is characterized in that The computer program product comprises computer program instructions, and when the computer program instructions are executed by a processor, the data processing method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Wind farm single-ring network multi-point fault rapid positioning method
CN105353272A
Firmware testing method, server and computer readable storage medium
CN113127338A
Data processing method and device, electronic equipment and computer readable storage medium
CN114095191A
Leader node election method and system, storage medium and equipment
CN114189421A
Performance test method and device, electronic equipment and computer readable storage medium
CN114567571A
