CN111597026B - Method and device for acquiring information - Google Patents

Method and device for acquiring information Download PDF

Info

Publication number
CN111597026B
CN111597026B CN202010412469.1A CN202010412469A CN111597026B CN 111597026 B CN111597026 B CN 111597026B CN 202010412469 A CN202010412469 A CN 202010412469A CN 111597026 B CN111597026 B CN 111597026B
Authority
CN
China
Prior art keywords
information
data
thread
data processing
statistics
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.)
Active
Application number
CN202010412469.1A
Other languages
Chinese (zh)
Other versions
CN111597026A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202010412469.1A priority Critical patent/CN111597026B/en
Publication of CN111597026A publication Critical patent/CN111597026A/en
Application granted granted Critical
Publication of CN111597026B publication Critical patent/CN111597026B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system

Abstract

The embodiment of the disclosure discloses a method and a device for acquiring information. One embodiment of the method comprises the following steps: generating a first thread and a second thread in response to detecting the data processing request; controlling the first thread to process the data of the data processing request, and controlling the second thread to record the data processing information of the first thread; and in response to detecting a data processing completion signal corresponding to the first thread, marking the information acquired by the second thread as recorded information. This embodiment enables the acquisition of the recorded information.

Description

Method and device for acquiring information
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a method and a device for acquiring information.
Background
The distributed system may include a control server and a data processing server. The data processing server can provide data processing service to the outside. The control server is used for controlling the data processing server so that the data processing server can normally operate.
Disclosure of Invention
The embodiment of the disclosure provides a method and a device for acquiring information.
In a first aspect, embodiments of the present disclosure provide a method for obtaining information, the method comprising: generating a first thread and a second thread in response to detecting the data processing request; controlling the first thread to process the data of the data processing request, and controlling the second thread to record the data processing information of the first thread; and in response to detecting a data processing completion signal corresponding to the first thread, marking the information acquired by the second thread as recorded information.
In some embodiments, the above-described recorded information includes at least one of: the method further comprises the steps of: storing the recorded information to local recorded information, wherein the local recorded information stores historical recorded information of the current equipment within a set time range; and carrying out classified statistics on the information in the local record information to obtain data statistics information corresponding to the current equipment, wherein the data statistics information comprises a time stamp and an equipment identifier.
In some embodiments, the above method comprises: and sending the data statistical information to the control node according to the set time period.
In some embodiments, the above method comprises: and deleting the local record information in response to the detection of the successful information transmission signal sent by the control node.
In a second aspect, embodiments of the present disclosure provide a method for obtaining information, the method comprising: receiving at least one piece of data statistical information sent by at least one service node, wherein the data statistical information comprises data processing information within a set time of the service node; and carrying out data processing on the at least one piece of data statistical information to obtain target statistical information.
In some embodiments, the data processing of the at least one piece of data statistics to obtain target statistics includes: and processing the data statistics information according to a first setting condition to obtain target statistics information in response to the number of the at least one service node being one.
In some embodiments, the data statistics include a timestamp and a device identifier, and the data processing the at least one piece of data statistics to obtain target statistics includes: responding to the number of the at least one service node as a plurality of service nodes, and carrying out data alignment on data statistics information sent by the plurality of service nodes to obtain initial statistics information; processing the initial statistical information according to a second set condition to obtain target statistical information, wherein the second set condition comprises at least one of the following: timestamp, device identification, application name.
In a third aspect, embodiments of the present disclosure provide an apparatus for acquiring information, the apparatus comprising: a thread generation unit configured to generate a first thread and a second thread in response to detecting the data processing request; an information processing unit configured to control the first thread to perform data processing on the data processing request, and control the second thread to record data processing information of the first thread; and a recording information acquisition unit configured to mark information acquired by the second thread as recording information in response to detection of a data processing completion signal corresponding to the first thread.
In some embodiments, the above-described recorded information includes at least one of: the application name, the number of requests, the request time, the data result generation time, and the device further comprises: an information storage unit configured to store the recording information to local recording information, the local recording information storing history information of the current device within a set time range; and the data statistical information acquisition unit is configured to classify and count the information in the local record information to obtain the data statistical information corresponding to the current equipment, wherein the data statistical information comprises a time stamp and an equipment identifier.
In some embodiments, the apparatus comprises: and the information sending unit is configured to send the data statistical information to the control node according to a set time period.
In some embodiments, the apparatus comprises: and the information deleting unit is used for responding to the information transmission success signal sent by the control node and is configured to delete the local record information.
In a fourth aspect, embodiments of the present disclosure provide an apparatus for acquiring information, the apparatus comprising: an information receiving unit configured to receive at least one piece of data statistics information sent from at least one service node, the data statistics information including data processing information within a set time of the service node; and the target statistical information acquisition unit is configured to perform data processing on the at least one piece of data statistical information to obtain target statistical information.
In some embodiments, the target statistics obtaining unit includes: and the first target statistical information acquisition subunit is used for responding to the fact that the number of the at least one service node is one and is configured to process the data statistical information according to a first setting condition to obtain target statistical information.
In some embodiments, the data statistics include a time stamp and a device identifier, and the target statistics acquisition unit includes: a data alignment subunit, configured to perform data alignment on data statistics information sent by a plurality of service nodes to obtain initial statistics information in response to the plurality of at least one service node; the second target statistical information acquisition subunit is configured to process the initial statistical information according to a second set condition to obtain target statistical information, wherein the second set condition comprises at least one of the following: timestamp, device identification, application name.
In a fifth aspect, embodiments of the present disclosure provide an electronic device, comprising: one or more processors; and a memory having one or more programs stored thereon, which when executed by the one or more processors, cause the one or more processors to perform the method for acquiring information of the first aspect or the method for acquiring information of the second aspect.
In a sixth aspect, embodiments of the present disclosure provide a computer readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method for acquiring information of the first aspect or the method for acquiring information of the second aspect described above.
The method and the device for acquiring information provided by the embodiment of the disclosure firstly generate the first thread and the second thread when the data processing request is detected, so that different data processing tasks are not interfered with each other; then the first thread is controlled to process the data of the data processing request, and the second thread is controlled to record the data processing information of the first thread, so that the normal data processing of the first thread on the data processing request can be ensured, and the data processing information of the first thread can be monitored in real time through the second thread; and finally, when the data processing completion signal corresponding to the first thread is detected, marking the information acquired by the second thread as recording information, and acquiring the recording information under the condition of not adding additional hardware or software.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for better understanding of the present solution and do not constitute a limitation of the present application. Wherein:
FIG. 1 is a schematic diagram according to a first embodiment of the present application;
FIG. 2 is a schematic diagram according to a second embodiment of the present application;
FIG. 3 is a schematic diagram according to a third embodiment of the present application;
FIG. 4 is a schematic diagram according to a fourth embodiment of the present application;
FIG. 5 is a block diagram of an electronic device for implementing a method for obtaining information corresponding to FIGS. 2 and 3 in accordance with an embodiment of the present application;
FIG. 6 is a block diagram of an electronic device for implementing a method for obtaining information corresponding to FIG. 4 in accordance with an embodiment of the present application;
fig. 7 is a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present application to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 illustrates an exemplary system architecture 100 to which a method for acquiring information or an apparatus for acquiring information of an embodiment of the present disclosure may be applied.
As shown in fig. 1, a system architecture 100 may include service nodes 101, 102, 103, a network 104, and a control node 105. The service nodes 101, 102, 103 and the control node 105 may constitute a distributed network. Network 104 is the medium used to provide communication links between serving nodes 101, 102, 103 and control node 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The service nodes 101, 102, 103 interact with the control node 105 via the network 104 to receive or send messages or the like. The service nodes 101, 102, 103 may each independently provide data processing services externally. Various data processing applications may be installed on the service nodes 101, 102, 103, such as web browser applications, shopping class applications, search class applications, instant messaging tools, mailbox clients, social platform software, and the like.
The service nodes 101, 102, 103 may be hardware or software. When serving nodes 101, 102, 103 are hardware, they may be various electronic devices having a display screen and supporting data processing, including but not limited to laptop computers, desktop computers, and the like. When the service nodes 101, 102, 103 are software, they can be installed in the above-listed electronic devices. Which may be implemented as multiple software or software modules (e.g., to provide distributed services), or as a single software or software module, without limitation.
The control node 105 may be a server providing various services, such as a server controlling the service nodes 101, 102, 103. The server may configure the service nodes 101, 102, 103 and control the service nodes 101, 102, 103 to collect respective local data information to obtain statistics related to the overall distributed system.
It should be noted that the method for acquiring information provided by the embodiments of the present disclosure may be performed by the service nodes 101, 102, 103 alone or may be performed by the service nodes 101, 102, 103 and the control node 105 together. Accordingly, the means for acquiring information may be provided in the service nodes 101, 102, 103 or in the control node 105.
The service nodes 101, 102, 103 and the control node 105 may be hardware or software. When the service nodes 101, 102, 103 and the control node 105 are hardware, they may be implemented as a distributed server cluster formed by a plurality of servers, or may be implemented as a single server. When the service nodes 101, 102, 103 and the control node 105 are software, they may be implemented as a plurality of software or software modules (for example, to provide distributed services), or may be implemented as a single software or software module, which is not specifically limited herein.
It should be understood that the number of serving nodes, networks and control nodes in fig. 1 is merely illustrative. There may be any number of service nodes, networks, and control nodes, as desired for implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a method for obtaining information according to the present disclosure is shown. The method for acquiring information includes the steps of:
in response to detecting the data processing request, a first thread and a second thread are generated, step 201.
In the present embodiment, an execution subject of the method for acquiring information (e.g., the service nodes 101, 102, 103 shown in fig. 1) may receive a data processing request through a wired connection or a wireless connection. The data processing request may be sent to the execution body when the user terminal connected to the execution body needs to provide the data service. It should be noted that the wireless connection may include, but is not limited to, 3G/4G connections, wiFi connections, bluetooth connections, wiMAX connections, zigbee connections, UWB (Ultra Wideband) connections, and other now known or later developed wireless connection means.
In the prior art, in order to count relevant data processing information of a distributed system, a technician may implement data statistics of the distributed system by sharing a cache, collecting a log of each data processing server, collecting memory data of each data processing server, and the like. However, the existing various data statistics methods generally bring additional data processing pressure to the data processing server, which affects the normal processing time of the data and even causes the data to be unable to be processed normally.
For this purpose, the execution body of the present application may generate the first thread and the second thread when detecting a data processing request. Wherein the first thread and the second thread may each perform different data processing tasks. Thus, different data processing tasks are not interfered with each other.
According to actual needs, the execution body can generate a plurality of first threads and a plurality of second threads, and the execution body depends on the actual needs.
Step 202, controlling the first thread to process data on the data processing request, and controlling the second thread to record data processing information of the first thread.
The execution body may control the first thread and the second thread to perform different data processing tasks, respectively. The execution body may control the first thread to perform data processing on the data processing request. The first thread can perform data processing according to the data processing request until a data processing result corresponding to the data processing request is returned to the user terminal. The second thread may record data processed by the first thread as the first thread processes the data. The second thread can record all data when the first thread processes the data, and can also record formulated data selectively. Therefore, normal data processing of the data processing request by the first thread can be ensured, and the data processing information of the first thread can be monitored in real time by the second thread.
And step 203, in response to detecting the data processing completion signal corresponding to the first thread, marking the information collected by the second thread as record information.
When the execution body detects a data processing completion signal of the first thread (for example, a data processing result corresponding to the data processing request may be sent to the user terminal, or the first thread is cancelled, etc.), it is indicated that the first thread completes the data processing process corresponding to the data processing request. At this time, the execution body may mark the information recorded by the second thread as recorded information. The record information contains information recorded by the second thread about the process of the first thread processing the data processing request. On the premise of ensuring normal data processing of the data processing request, the second thread acquires the recorded information in real time, so that timeliness of acquiring the recorded information is improved. The acquisition of the recorded information of the service node under the distributed system is realized under the condition that no additional hardware or software is added.
With continued reference to fig. 3, a flow 300 of one embodiment of a method for obtaining information according to the present disclosure is shown. The method for acquiring information can be applied to a distributed system, and comprises the following steps:
in response to detecting the data processing request, a first thread and a second thread are generated, step 301.
The content of step 301 is the same as that of step 201, and will not be described in detail here.
Step 302, controlling the first thread to perform data processing on the data processing request, and controlling the second thread to record data processing information of the first thread.
The content of step 302 is the same as step 202 and will not be described in detail here.
In step 303, in response to detecting the data processing completion signal corresponding to the first thread, the information recorded by the second thread is marked as recorded information.
The content of step 303 is the same as that of step 203, and will not be described in detail here.
Step 304, the recorded information is saved to the local recorded information.
In order to reduce the data processing amount of the execution subject and reduce network congestion, the execution subject can save record information. Specifically, after the recorded information is obtained, the execution body may save the recorded information to the local recorded information. Wherein, the above-mentioned record information can include at least one of the following: application name, number of requests, request time, data result generation time. The local record information stores the history record information of the current device (i.e. the execution subject) within a set time range. That is, the history information is composed of at least one piece of recording information obtained before the execution subject.
And 305, carrying out classification statistics on the information in the local record information to obtain the data statistics information corresponding to the current equipment.
The executing body may perform classification statistics on information in the locally recorded information to evaluate a process of processing the data processing request by the first thread, and the obtained data statistics information may reflect a data processing state, a network state, a device performance, and the like of the executing body. Wherein the classification statistics may include at least one of: the application name, the number of requests, the request time, the data result generation time, and may further include the number of request failures, the number of request successes, the longest time consumption, the shortest time consumption, the average time consumption, and the like.
The executing entity may be in a distributed network and the data statistics may include a time stamp and a device identification for the subsequent control node 105 to make data statistics for individual service nodes.
And step 306, transmitting the data statistical information to the control node according to the set time period.
The execution main body can send the data statistical information to the control node 105 according to a set time period, so that the control node 105 can timely acquire the running state of the data on the execution main body, the number of data interaction between the execution main body and the control node is reduced, network congestion is reduced, and the data transmission effectiveness is improved. Wherein, the control node can be used for counting the data information of the distributed system.
Step 307, deleting the local record information in response to detecting the information transmission success signal sent by the control node.
When receiving the information transmission success signal of the corresponding data statistics information sent by the control node 105, the executing main body can delete the local record information, so as to reduce occupation of the data space on the executing main body, and be beneficial to improving the data processing efficiency of the executing main body.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method for obtaining information is shown. The flow 400 of the method for obtaining information, corresponding to the embodiment of fig. 3, comprises the steps of:
step 401, receiving at least one piece of data statistics sent by at least one service node.
In this embodiment, the execution body of the method for acquiring information (for example, the control node 105 shown in fig. 1) may receive the data statistics information sent from the service nodes 101, 102, 103 through a wired connection or a wireless connection. The data statistics information may include data processing information within a set time of the service node.
The service nodes 101, 102, 103 each process data tasks, and after acquiring corresponding data statistics information, each process data statistics information sent to the execution subject. Thus, the times at which the executing bodies receive the data statistics information sent by the service nodes 101, 102, 103 may be different.
After receiving the data statistics information, the execution body may send an information transmission success signal to the corresponding service node, so that the service node may delete the corresponding local record information. Therefore, the occupied data space on the service node is reduced, and the data processing efficiency of the service node is improved.
And step 402, performing data processing on the at least one piece of data statistics information to obtain target statistics information.
The execution subject can perform data processing on the data statistics according to various screening conditions to obtain target statistics. The screening conditions may be time, application, client, IP address, etc. As can be seen from the above description, the service nodes 101, 102, 103 independently complete the acquisition of data statistics. Thus, the executing body processes the data statistics information sent by the service nodes 101, 102, 103, and the obtained target statistics information may include data processing information of each service node in the distributed system. In this way, data statistics for distributed systems are achieved.
In some optional implementations of this embodiment, the data processing for the at least one piece of data statistics to obtain target statistics includes: and processing the data statistics information according to a first setting condition to obtain target statistics information in response to the number of the at least one service node being one.
When the executing body only receives the data statistical information sent by one service node, the executing body can process the data statistical information according to the first setting condition to obtain target statistical information. Thus, the data processing efficiency is improved. Wherein the first setting condition may be time, application, customer, etc.
In some optional implementations of this embodiment, the data statistics include a timestamp and a device identifier, and the data processing is performed on the at least one piece of data statistics to obtain target statistics, where the method includes the following steps:
and the first step, responding to the plurality of at least one service node, and carrying out data alignment on the data statistics information sent by the plurality of service nodes to obtain initial statistics information.
As can be seen from the above description, the respective service nodes 101, 102, 103 collect data statistics independently, and the time for the execution subject to obtain the data statistics is different. In order to implement statistics on data, the execution body may first align data statistics information to obtain initial statistics information for subsequent data statistics. The alignment may be performed according to a time point, according to a time period, according to a network area where the service node is located, and so on. The alignment according to the time points may be to divide the data statistics into a plurality of sets according to whether the transmission times of the data statistics are the same. The alignment by time period may be to divide the data statistics into a plurality of sets by the time period in which the data statistics are transmitted (for example, the time period may be divided by less than half an hour). The alignment according to the network area where the service node is located may be to divide the data statistics belonging to the same network area into a plurality of sets. Therefore, when information statistics is carried out through initial statistical information, the same precondition is provided, and the effectiveness of target statistical information is improved.
And step two, processing the initial statistical information according to a second set condition to obtain target statistical information.
After the initial statistical information is obtained, the executing main body can process the initial statistical information according to the second setting condition to obtain target statistical information. The target statistics may characterize the data processing information of the distributed system. In this way, data statistics for distributed systems are achieved. Wherein the second setting condition may include at least one of: timestamp, device identification, application name.
With further reference to fig. 5, as an implementation of the method shown in the foregoing figures, the present disclosure provides an embodiment of an apparatus for acquiring information, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 5, the apparatus 500 for acquiring information of the present embodiment may include: a thread generation unit 501, an information processing unit 502, and a record information acquisition unit 503. Wherein, the thread generating unit 501 is configured to generate a first thread and a second thread in response to detecting a data processing request; an information processing unit 502 configured to control the first thread to perform data processing on the data processing request, and control the second thread to record data processing information of the first thread; the recording information obtaining unit 503 is configured to mark information collected by the second thread as recording information in response to detection of a data processing completion signal corresponding to the first thread.
In some optional implementations of this embodiment, the recording information includes at least one of: the application name, the number of requests, the request time, the data result generation time, and the apparatus 500 for acquiring information may further include: an information storage unit (not shown in the figure) and a data statistical information acquisition unit (not shown in the figure). The information storage unit is configured to store the recording information to local recording information, wherein the local recording information stores history recording information of the current equipment within a set time range; and the data statistical information acquisition unit is configured to classify and count the information in the local record information to obtain the data statistical information corresponding to the current equipment, wherein the data statistical information comprises a time stamp and an equipment identifier.
In some optional implementations of this embodiment, the apparatus 500 for acquiring information may include: an information transmitting unit (not shown in the figure) configured to transmit the data statistics information to the control node in a set time period.
In some optional implementations of this embodiment, the apparatus 500 for acquiring information may include: an information deleting unit (not shown in the figure) is configured to delete the local record information in response to detecting the information transmission success signal sent from the control node.
With further reference to fig. 6, as an implementation of the method shown in the foregoing figures, the present disclosure provides an embodiment of an apparatus for acquiring information, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 4, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 6, the apparatus 600 for acquiring information of the present embodiment may include: an information receiving unit 601 and a target statistical information acquiring unit 602. Wherein, the information receiving unit 601 is configured to receive at least one piece of data statistics information sent by at least one service node, where the data statistics information includes data processing information within a set time of the service node; the target statistics obtaining unit 602 is configured to perform data processing on the at least one piece of data statistics to obtain target statistics.
In some optional implementations of this embodiment, the target statistics obtaining unit 602 may include: a first target statistics obtaining subunit (not shown in the figure), responsive to the number of the at least one service node being one, is configured to process the data statistics according to a first setting condition to obtain target statistics.
In some optional implementations of this embodiment, the data statistics includes a timestamp and a device identifier, and the target statistics obtaining unit 602 may include: a data alignment subunit (not shown) and a second target statistics acquisition subunit (not shown). The data alignment subunit is used for responding to the fact that the number of the at least one service node is a plurality of service nodes and is configured to perform data alignment on data statistics information sent by the plurality of service nodes to obtain initial statistics information; the second target statistical information acquisition subunit is configured to process the initial statistical information according to a second set condition to obtain target statistical information, wherein the second set condition comprises at least one of the following: timestamp, device identification, application name.
According to embodiments of the present application, there is also provided an electronic device, a readable storage medium and a computer program product.
As shown in fig. 7, a block diagram of an electronic device for acquiring information according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the application described and/or claimed herein.
As shown in fig. 7, the electronic device includes: one or more processors 701, memory 702, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In other embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple electronic devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 701 is illustrated in fig. 7.
Memory 702 is a non-transitory computer-readable storage medium provided herein. The memory stores instructions executable by the at least one processor to cause the at least one processor to perform the methods for obtaining information provided herein. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the methods for obtaining information provided herein.
The memory 702 is used as a non-transitory computer readable storage medium for storing a non-transitory software program, a non-transitory computer executable program, and modules such as program instructions/modules (e.g., the thread generating unit 501, the information processing unit 502, and the recorded information acquiring unit 503 shown in fig. 5) corresponding to the method for acquiring information in the embodiment of the present application. The processor 701 executes various functional applications of the server and data processing, i.e., implements the method for acquiring information in the above-described method embodiments, by running non-transitory software programs, instructions, and modules stored in the memory 702.
Memory 702 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created according to the use of the electronic device for the method of acquiring information, and the like. In addition, the memory 702 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 702 optionally includes memory provided remotely from processor 701, which may be connected to the electronic device for the method of obtaining information via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device for the method of acquiring information may further include: an input device 703 and an output device 704. The processor 701, the memory 702, the input device 703 and the output device 704 may be connected by a bus or otherwise, in fig. 7 by way of example.
The input device 703 may receive input numeric or character information and generate key signal inputs related to user settings and function controls of the electronic device used to obtain the information, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointer stick, one or more mouse buttons, a track ball, a joystick, and the like. The output device 704 may include a display apparatus, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASIC (application specific integrated circuit), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
These computing programs (also referred to as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented in a high-level procedural and/or object-oriented programming language, and/or in assembly/machine language. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme of the embodiment of the application, when the data processing request is detected, the first thread and the second thread are generated, so that different data processing tasks are not interfered with each other; then the first thread is controlled to process the data of the data processing request, and the second thread is controlled to record the data processing information of the first thread, so that the normal data processing of the first thread on the data processing request can be ensured, and the data processing information of the first thread can be monitored in real time through the second thread; and finally, when the data processing completion signal corresponding to the first thread is detected, marking the information acquired by the second thread as recording information, and acquiring the recording information under the condition of not adding additional hardware or software.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, provided that the desired results of the technical solutions disclosed in the present application can be achieved, and are not limited herein.
The above embodiments do not limit the scope of the application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application are intended to be included within the scope of the present application.

Claims (14)

1. A method for obtaining information, applied to a service node in a distributed network, comprising:
generating a first thread and a second thread in response to detecting the data processing request;
controlling the first thread to process the data of the data processing request, and controlling the second thread to record the data processing information of the first thread, wherein the data processing information comprises the request times;
in response to detecting a data processing completion signal corresponding to the first thread, marking information acquired by the second thread as recording information, and storing the recording information to local recording information, wherein the local recording information stores historical recording information of current equipment within a set time range;
carrying out classified statistics on the information in the local record information to obtain data statistics information corresponding to the current equipment;
transmitting the data statistical information to a control node according to a set time period, wherein the control node utilizes the received statistical information to count the data information of the distributed system;
wherein, each service node in the distributed system respectively and independently collects data statistical information.
2. The method of claim 1, wherein the recorded information comprises at least one of: application name, request time, data result generation time
The data statistics include a timestamp and a device identification.
3. The method according to claim 1, wherein the method comprises:
and deleting the local record information in response to the detection of the successful information transmission signal sent by the control node.
4. A method for obtaining information, applied to a control node in a distributed network, comprising:
receiving at least one piece of data statistics information sent by at least one service node, wherein the data statistics information comprises data processing information within a set time of the service node, and the service node is used for executing the method of one of claims 1 to 3;
and carrying out data processing on the at least one piece of data statistical information to obtain target statistical information.
5. The method of claim 4, wherein the data processing the at least one piece of data statistics to obtain target statistics comprises:
and responding to the number of the at least one service node as one, and processing the data statistical information according to a first setting condition to obtain target statistical information.
6. The method of claim 4, wherein the data statistics include a timestamp and a device identification, and
the data processing is performed on the at least one piece of data statistics information to obtain target statistics information, including:
responding to the number of the at least one service node as a plurality of service nodes, and carrying out data alignment on data statistics information sent by the plurality of service nodes to obtain initial statistics information;
processing the initial statistical information according to a second set condition to obtain target statistical information, wherein the second set condition comprises at least one of the following: timestamp, device identification, application name.
7. An apparatus for obtaining information, for use in a service node in a distributed network, comprising:
a thread generation unit configured to generate a first thread and a second thread in response to detecting the data processing request;
an information processing unit configured to control the first thread to perform data processing on the data processing request, and control the second thread to record data processing information of the first thread, the data processing information including the number of requests;
a recording information acquisition unit configured to mark information acquired by the second thread as recording information in response to detection of a data processing completion signal corresponding to the first thread;
an information storage unit configured to store the recording information to local recording information, the local recording information storing history information of a current device within a set time range;
the data statistics information acquisition unit is configured to classify and count the information in the local record information to obtain data statistics information corresponding to the current equipment;
an information transmitting unit configured to transmit the data statistics information to a control node according to a set time period, wherein the control node counts data information of a distributed system using the received statistics information;
wherein, each service node in the distributed system respectively and independently collects data statistical information.
8. The apparatus of claim 7, wherein the recorded information comprises at least one of: the application name, the request time, the data result generation time, and the data statistics include a timestamp and a device identification.
9. The apparatus of claim 7, wherein the apparatus comprises:
and the information deleting unit is used for responding to the information transmission success signal sent by the control node and is configured to delete the local record information.
10. An apparatus for obtaining information, for use in a control node in a distributed network, comprising:
an information receiving unit configured to receive at least one piece of data statistics information sent by at least one service node, the data statistics information comprising data processing information within a service node set time, wherein the service node is configured to perform the method of one of claims 1-3;
the target statistical information acquisition unit is configured to perform data processing on the at least one piece of data statistical information to obtain target statistical information.
11. The apparatus of claim 10, wherein the target statistics acquisition unit comprises:
and the first target statistical information acquisition subunit is used for responding to the fact that the number of the at least one service node is one and is configured to process the data statistical information according to a first setting condition to obtain target statistical information.
12. The apparatus of claim 10, wherein the data statistics include a timestamp and a device identification, and
the target statistical information acquisition unit includes:
a data alignment subunit, responding to the plurality of at least one service node, configured to perform data alignment on data statistics information sent by the plurality of service nodes, so as to obtain initial statistics information;
the second target statistical information acquisition subunit is configured to process the initial statistical information according to a second set condition to obtain target statistical information, wherein the second set condition comprises at least one of the following: timestamp, device identification, application name.
13. An electronic device, comprising:
one or more processors;
a memory having one or more programs stored thereon,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-3 or the method of any of claims 4-6.
14. A computer readable medium on which a computer program is stored, characterized in that the program, when executed by a processor, implements the method of any one of claims 1 to 3 or the method of any one of claims 4 to 6.
CN202010412469.1A 2020-05-15 2020-05-15 Method and device for acquiring information Active CN111597026B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010412469.1A CN111597026B (en) 2020-05-15 2020-05-15 Method and device for acquiring information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010412469.1A CN111597026B (en) 2020-05-15 2020-05-15 Method and device for acquiring information

Publications (2)

Publication Number Publication Date
CN111597026A CN111597026A (en) 2020-08-28
CN111597026B true CN111597026B (en) 2023-06-30

Family

ID=72182861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010412469.1A Active CN111597026B (en) 2020-05-15 2020-05-15 Method and device for acquiring information

Country Status (1)

Country Link
CN (1) CN111597026B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112231114A (en) * 2020-09-22 2021-01-15 深圳云天励飞技术股份有限公司 Event processing method and related equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559219A (en) * 2013-10-18 2014-02-05 北京京东尚科信息技术有限公司 Distributed web crawler capture task dispatching method, dispatching-side device and capture nodes
CN106569729A (en) * 2015-10-09 2017-04-19 阿里巴巴集团控股有限公司 Method and device for writing in data in distributed system

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6708175B2 (en) * 2001-06-06 2004-03-16 International Business Machines Corporation Program support for disk fencing in a shared disk parallel file system across storage area network
CN102819478B (en) * 2012-07-20 2015-09-02 中国科学院西安光学精密机械研究所 A kind of data handling system monitoring and management method without agency
CN103533572A (en) * 2013-10-24 2014-01-22 广东欧珀移动通信有限公司 WIFI performance automation testing method and device
US9753526B2 (en) * 2014-12-23 2017-09-05 Intel Corporation Systems and methods for synergistic software-hardware power budget management
CN105700938B (en) * 2016-01-15 2019-02-19 浪潮通用软件有限公司 A kind of method and device of multiple threads data
CN106227583B (en) * 2016-07-18 2019-08-27 青岛科信安全技术有限公司 A kind of multiple thread video Real-time Data Processing Method and device
CN108549586B (en) * 2018-04-17 2022-04-01 百度在线网络技术(北京)有限公司 Information processing method and device
CN110046187B (en) * 2018-12-25 2023-10-27 创新先进技术有限公司 Data processing system, method and device
CN109741743B (en) * 2019-01-10 2021-03-05 深圳市江波龙电子股份有限公司 Equipment control method and device and nonvolatile storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559219A (en) * 2013-10-18 2014-02-05 北京京东尚科信息技术有限公司 Distributed web crawler capture task dispatching method, dispatching-side device and capture nodes
CN106569729A (en) * 2015-10-09 2017-04-19 阿里巴巴集团控股有限公司 Method and device for writing in data in distributed system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
The ganglia distributed monitoring system: design, implementation, and experience;Matthew L Massie 等;《Parallel Computing》;第30卷(第7期);817-840 *
Yang Zhao 等.A Programming Model for Time-Synchronized Distributed Real-Time Systems.《13th IEEE Real Time and Embedded Technology and Applications Symposium (RTAS'07)》.2007,259-268. *
分布式数据采集分析系统的设计与实现;张伟;《中国优秀硕士学位论文全文数据库 信息科技辑》(第02(2019)期);I140-1082 *

Also Published As

Publication number Publication date
CN111597026A (en) 2020-08-28

Similar Documents

Publication Publication Date Title
CN111831420B (en) Method for task scheduling, related device and computer program product
CN111753997B (en) Distributed training method, system, device and storage medium
CN111858248B (en) Application monitoring method, device, equipment and storage medium
US9389943B2 (en) Determining a number of unique incidents in a plurality of incidents for incident processing in a distributed processing system
CN111756579A (en) Abnormity early warning method, device, equipment and storage medium
CN111694646A (en) Resource scheduling method and device, electronic equipment and computer readable storage medium
CN112491617B (en) Link tracking method, device, electronic equipment and medium
CN114090366A (en) Method, device and system for monitoring data
CN111597026B (en) Method and device for acquiring information
JP2010128597A (en) Information processor and method of operating the same
CN113825170A (en) Method and apparatus for determining network channel
CN112395126A (en) Fault log processing method and device, electronic equipment and storage medium
CN111865720A (en) Method, apparatus, device and storage medium for processing request
CN112735601B (en) Test method, device and equipment for determining infectious disease close-contact population by using Bluetooth
CN111726402B (en) User behavior data processing method and device, electronic equipment and storage medium
CN111581049B (en) Distributed system running state monitoring method, device, equipment and storage medium
CN112099933B (en) Task operation and query method and device, electronic equipment and storage medium
US20160034919A1 (en) Collection and aggregation of large volume of metrics
CN112437152B (en) Crash processing method and device, electronic equipment and storage medium
CN111930748B (en) Method, device, equipment and storage medium for tracking data of streaming computing system
CN111835857B (en) Method and apparatus for accessing data
CN111031105B (en) Statistical method, device, equipment and storage medium for message frequency in automatic driving
CN113746933A (en) Method and device for displaying information
CN114153872A (en) Data processing method and device based on measurement indexes
CN112307372A (en) Data processing method and device

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