CN111597026A - Method and device for acquiring information - Google Patents

Method and device for acquiring information Download PDF

Info

Publication number
CN111597026A
CN111597026A CN202010412469.1A CN202010412469A CN111597026A CN 111597026 A CN111597026 A CN 111597026A CN 202010412469 A CN202010412469 A CN 202010412469A CN 111597026 A CN111597026 A CN 111597026A
Authority
CN
China
Prior art keywords
information
data
statistical information
thread
data processing
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.)
Granted
Application number
CN202010412469.1A
Other languages
Chinese (zh)
Other versions
CN111597026B (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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the disclosure discloses a method and a device for acquiring information. One embodiment of the method comprises: generating a first thread and a second thread in response to detecting a data processing request; 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; and marking the information collected by the second thread as recording information in response to detecting a data processing completion signal corresponding to the first thread. This embodiment enables acquisition of the recording 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
A 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 run.
Disclosure of Invention
The embodiment of the disclosure provides a method and a device for acquiring information.
In a first aspect, an embodiment of the present disclosure provides a method for acquiring information, the method including: generating a first thread and a second thread in response to detecting a data processing request; 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; and marking the information collected by the second thread as recording information in response to detecting a data processing completion signal corresponding to the first thread.
In some embodiments, the logging information comprises at least one of: application name, number of requests, request time, data result generation time, and the method further comprises: storing the recorded information into local recorded information, wherein the local recorded information stores historical recorded information of current equipment in a set time range; and carrying out classified statistics on the information in the local recording information to obtain data statistical information corresponding to the current equipment, wherein the data statistical information comprises a timestamp and an equipment identifier.
In some embodiments, the above method comprises: and sending the data statistical information to a control node according to a set time period.
In some embodiments, the above method comprises: and deleting the local record information in response to detecting an information transmission success signal sent by the control node.
In a second aspect, an embodiment of the present disclosure provides a method for acquiring information, the method including: 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 in a set time of the service node; and performing data processing on the at least one piece of data statistical information to obtain target statistical information.
In some embodiments, the performing data processing on the at least one piece of data statistical information to obtain the target statistical information includes: and responding to the number of the at least one service node as one, and processing the data statistical information according to a first set condition to obtain target statistical information.
In some embodiments, the data statistics information includes a timestamp and a device identifier, and the performing data processing on the at least one piece of data statistics information to obtain the target statistics information includes: responding to the number of the at least one service node being multiple, and performing data alignment on data statistical information sent by the multiple service nodes to obtain initial statistical 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 items: timestamp, device identification, application name.
In a third aspect, an embodiment of the present disclosure provides an apparatus for acquiring information, the apparatus including: 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 the record information acquisition unit is used for responding to the detection of the data processing completion signal corresponding to the first thread and marking the information collected by the second thread as record information.
In some embodiments, the logging information comprises at least one of: the application name, the number of requests, the request time, the data result generation time, and the apparatus further comprises: an information storage unit configured to store the recording information to local recording information, wherein the local recording information stores history information of the current device in a set time range; and the data statistical information acquisition unit is configured to perform classified statistics on the information in the local recording information to obtain data statistical information corresponding to the current equipment, wherein the data statistical information comprises a timestamp and an equipment identifier.
In some embodiments, the apparatus comprises: and the information sending unit is configured to send the data statistic 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 detection of the information transmission success signal sent by the control node and deleting the local record information.
In a fourth aspect, an embodiment of the present disclosure provides an apparatus for acquiring information, the apparatus including: the information receiving unit is configured to receive at least one piece of data statistical information sent by at least one service node, wherein the data statistical information comprises data processing information in 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 statistical information obtaining unit includes: and the first target statistical information acquisition subunit, in response to the number of the at least one service node being one, is configured to process the data statistical information according to a first set condition to obtain target statistical information.
In some embodiments, the data statistic information includes a timestamp and a device identifier, and the target statistic information obtaining unit includes: the data alignment subunit, configured to perform data alignment on data statistics information sent by a plurality of the service nodes in response to that the number of the at least one service node is multiple, to obtain initial statistics information; a second target statistical information obtaining subunit, configured to process the initial statistical information according to a second set condition, to obtain target statistical information, where the second set condition includes at least one of: timestamp, device identification, application name.
In a fifth aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors; a memory on which one or more programs are stored, the one or more programs, when executed by the one or more processors, causing 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, an embodiment of the present disclosure provides a computer-readable medium, on which a computer program is stored, 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.
According to the method and the device for acquiring information, the first thread and the second thread are generated 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 perform data processing on the data processing request, and the second thread is controlled to record the data processing information of the first thread, so that normal data processing of the first thread on the data processing request can be guaranteed, and the data processing information of the first thread can be monitored in real time through the second thread; and finally, when a data processing completion signal corresponding to the first thread is detected, the information acquired by the second thread is marked as recording information, and the recording information is acquired under the condition of not adding extra hardware or software.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit 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 illustration according to a third embodiment of the present application;
FIG. 4 is a schematic illustration according to a fourth embodiment of the present application;
FIG. 5 is a block diagram of an electronic device for implementing the method for acquiring information corresponding to FIGS. 2 and 3 according to an embodiment of the present application;
FIG. 6 is a block diagram of an electronic device for implementing the method for acquiring information corresponding to FIG. 4 according to the 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
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those 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 of a method for obtaining information or an apparatus for obtaining information to which embodiments of the present disclosure may be applied.
As shown in fig. 1, system architecture 100 may include service nodes 101, 102, 103, network 104, and control node 105. The service nodes 101, 102, 103 and the control node 105 may form a distributed network. Network 104 is used to provide a medium for communication links between serving nodes 101, 102, 103 and control node 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
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 to the outside. The service nodes 101, 102, 103 may have installed thereon various data processing applications, such as a web browser application, a shopping-like application, a search-like application, an instant messaging tool, a mailbox client, social platform software, and the like.
Service nodes 101, 102, 103 may be hardware or software. When service 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 portable computers, desktop computers, and the like. When the service nodes 101, 102, 103 are software, they may be installed in the electronic devices listed above. It may be implemented as a plurality of software or software modules (for example, for providing distributed services), or as a single software or software module, which is not specifically limited herein.
The control node 105 may be a server providing various services, for example, a server controlling the service nodes 101, 102, 103. The server may configure the service nodes 101, 102, and 103, and control the service nodes 101, 102, and 103 to collect respective local data information, so as to obtain statistical information related to the entire distributed system.
It should be noted that the method for acquiring information provided by the embodiment of the present disclosure may be executed by the service nodes 101, 102, and 103 individually, or may also be executed by the service nodes 101, 102, and 103 and the control node 105 together. Accordingly, the means for obtaining information may be provided in the service nodes 101, 102, 103, as well as 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 composed of multiple 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, and are not limited in this respect.
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 serving nodes, networks, and control nodes, as desired for an implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for obtaining information in accordance with the present disclosure is shown. The method for acquiring information comprises the following steps:
in response to detecting a data processing request, a first thread and a second thread are generated, step 201.
In this embodiment, the execution subject of the method for acquiring information (e.g., the service nodes 101, 102, 103 shown in fig. 1) may receive the data processing request by a wired connection manner or a wireless connection manner. The data processing request may be sent to the execution subject by a user terminal connected to the execution subject when the execution subject needs to provide a data service. It should be noted that the wireless connection means may include, but is not limited to, a 3G/4G connection, a WiFi connection, a bluetooth connection, a WiMAX connection, a Zigbee connection, a uwb (ultra wideband) connection, and other wireless connection means now known or developed in the future.
In the prior art, in order to count the relevant data processing information of the distributed system, a technician may perform data statistics on the distributed system by sharing a cache, collecting logs of each data processing server, collecting memory data of each data processing server, and the like. However, the existing various data statistics methods usually bring extra data processing pressure to the data processing server, which affects the normal processing time of the data, and even causes that the data cannot be processed normally.
For this reason, the execution subject of the present application may generate the first thread and the second thread when detecting the data processing request. Wherein the first thread and the second thread may respectively perform different data processing tasks. Therefore, the mutual interference of different data processing tasks is realized.
According to actual needs, the execution body can generate a plurality of first threads and a plurality of second threads, which are determined according to actual needs.
Step 202, 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 execution subject may control the first thread and the second thread to perform different data processing tasks, respectively. The execution subject may control the first thread to perform data processing on the data processing request. The first thread may 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 while the first thread performs data processing. The second thread may record all data of the first thread during data processing, or may selectively record the established data. Therefore, normal data processing of the first thread to the data processing request can be guaranteed, and data processing information of the first thread can be monitored in real time through the second thread.
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 recording information.
When the execution main body detects a data processing completion signal of the first thread (for example, the data processing result corresponding to the data processing request is sent to the user terminal, or the first thread is cancelled, etc.), it indicates 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 the record information. The record information contains information recorded by the second thread about the first thread's processing of the data processing request. On the premise of ensuring normal data processing of the data processing request, the recording information is acquired in real time through the second thread, and timeliness of acquiring the recording information is improved. Under the condition of not increasing extra hardware or software, the acquisition of the recording information of the service node in the distributed system is realized.
With continued reference to FIG. 3, a flow 300 of one embodiment of a method for obtaining information in accordance with 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 a 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 is not 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 is not described in detail here.
Step 303, in response to detecting the data processing completion signal corresponding to the first thread, marking the information recorded by the second thread as recorded information.
The content of step 303 is the same as that of step 203, and is not described in detail here.
Step 304, storing the recording information to local recording information.
In order to reduce the data processing amount of the execution subject and reduce network congestion, the execution subject may save the record information. Specifically, after obtaining the record information, the execution main body may save the record information to the local record information. Wherein the recording information may include at least one of: application name, request times, request time and data result generation time. The local record information is stored with history 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 record information obtained before the execution of the subject.
Step 305, performing classification statistics on the information in the local record information to obtain data statistics information corresponding to the current device.
The execution main body can perform classified statistics on the information in the local record information so as to evaluate the process of the first thread processing the data processing request, and the obtained data statistical information can reflect the data processing state, the network state, the equipment performance and the like of the execution main body. Wherein the classification statistics may include at least one of: the application name, the request times, the request time, and the data result generation time may further include the request failure times, the request success times, the longest time consumption, the shortest time consumption, the average time consumption, and the like.
The execution agent may be in a distributed network, and the data statistics information may include a timestamp and a device identification for the subsequent control node 105 to perform data statistics on individual service nodes.
And step 306, sending the data statistical information to the control node according to a 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 obtain the running state of the data on the execution main body in time, the number of data interaction between the execution main body and the control node is reduced, network congestion is reduced, and data transmission effectiveness is improved. The control node may be configured to count data information of the distributed system.
Step 307, in response to detecting the information transmission success signal sent by the control node, deleting the local recording information.
When receiving the information transmission success signal corresponding to the data statistical information from the control node 105, the execution main body may delete the local record information, so as to reduce the data space occupied on the execution main body, which is beneficial to improving the data processing efficiency of the execution main body.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method for obtaining information is shown. The process 400 of the method for obtaining information, corresponding to the embodiment of fig. 3, includes the following steps:
step 401, at least one piece of data statistical information sent by at least one service node is received.
In this embodiment, the execution subject of the method for acquiring information (e.g. the control node 105 shown in fig. 1) may receive the data statistics information sent by the service nodes 101, 102, 103 by a wired connection manner or a wireless connection manner. The data statistics information may include data processing information within a set time of the service node.
The service nodes 101, 102, and 103 process data tasks, and when acquiring corresponding data statistics information, send the data statistics information to the execution subject. Therefore, the time when the execution agent receives the data statistics information sent by the service nodes 101, 102, 103 may be different.
After receiving the data statistics information, the execution subject 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 data space occupied on the service node is reduced, and the data processing efficiency of the service node is improved.
Step 402, performing data processing on the at least one piece of data statistical information to obtain target statistical information.
The execution main body can perform data processing on the data statistical information according to various screening conditions to obtain the target statistical information. The filtering condition may be time, application, client, IP address, etc. As can be seen from the above description, the service nodes 101, 102, and 103 independently complete the data statistics acquisition. Therefore, the executive body processes the data statistical information sent by the service nodes 101, 102, 103, and the obtained target statistical information may include data processing information of each service node in the distributed system. Thus, data statistics of the distributed system are realized.
In some optional implementation manners of this embodiment, the performing data processing on the at least one piece of data statistical information to obtain target statistical information includes: and responding to the number of the at least one service node as one, and processing the data statistical information according to a first set condition to obtain target statistical information.
When the execution main body receives the data statistical information sent by only one service node, the execution main body can process the data statistical information according to a first set condition to obtain the target statistical information. Therefore, the data processing efficiency is improved. Wherein, the first setting condition may be time, application, client, etc.
In some optional implementation manners of this embodiment, the processing the at least one piece of data statistical information to obtain the target statistical information includes:
the first step, responding to the number of the at least one service node being multiple, performing data alignment on data statistical information sent by the multiple service nodes to obtain initial statistical information.
As can be seen from the above description, the service nodes 101, 102, and 103 independently collect data statistics information, and the execution time of the execution subject obtaining the data statistics information is also different. In order to realize data statistics, the execution subject may first align the data statistics information to obtain initial statistics information, so as to perform data statistics subsequently. The alignment mode may be alignment according to a time point, alignment according to a time period, alignment according to a network area where the service node is located, and the like. The time point alignment may be to divide the data statistics information into a plurality of sets according to whether the sending times of the data statistics information are the same. The aligning by time period may be dividing the data statistics into a plurality of sets by a time period in which the data statistics are transmitted (for example, a time period may be divided by less than half an hour). The aligning according to the network areas where the service nodes are located may be dividing the data statistics information belonging to the same network area into a plurality of sets. Therefore, the same precondition is provided when the information statistics is carried out through the initial statistical information, and the effectiveness of the target statistical information is improved.
And secondly, processing the initial statistical information according to a second set condition to obtain target statistical information.
After obtaining the initial statistical information, the execution main body may process the initial statistical information according to a second setting condition to obtain the target statistical information. The target statistics may characterize the data processing information of the distributed system. Thus, data statistics of the distributed system are realized. 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 methods shown in the above figures, the present disclosure provides an embodiment of an apparatus for acquiring information, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable to various electronic devices.
As shown in fig. 5, the apparatus 500 for acquiring information of the present embodiment may include: a thread generating unit 501, an information processing unit 502, and a record information acquiring unit 503. Wherein the thread generating unit 501, in response to detecting the data processing request, is configured to generate a first thread and a second thread; 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 log information obtaining unit 503 is configured to mark the information collected by the second thread as log information in response to detecting the data processing completion signal corresponding to the first thread.
In some optional implementations of this embodiment, the record information includes at least one of: the application name, the number of requests, the request time, and 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 record information to local record information, and the local record information stores history record information of the current equipment within a set time range; and the data statistical information acquisition unit is configured to perform classified statistics on the information in the local recording information to obtain data statistical information corresponding to the current equipment, wherein the data statistical information comprises a timestamp and an equipment identifier.
In some optional implementations of the present embodiment, the apparatus 500 for acquiring information may include: and an information sending unit (not shown in the figure) configured to send the data statistics information to the control node according to a set time period.
In some optional implementations of the present embodiment, the apparatus 500 for acquiring information may include: an information deleting unit (not shown in the figure) configured to delete the local recording information in response to detection of the information transmission success signal from the control node.
With further reference to fig. 6, as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of an apparatus for acquiring information, which corresponds to the method embodiment shown in fig. 4, and which is particularly applicable 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 acquisition unit 602. The information receiving unit 601 is configured to receive at least one piece of data statistical information sent by at least one service node, where the data statistical information includes data processing information within a set time of the service node; a target statistic information obtaining unit 602, configured to perform data processing on the at least one piece of data statistic information to obtain target statistic information.
In some optional implementations of the present embodiment, the target statistical information obtaining unit 602 may include: and a first target statistical information obtaining subunit (not shown in the figure), in response to that the number of the at least one service node is one, configured to process the data statistical information according to a first setting condition to obtain target statistical information.
In some optional implementations of this embodiment, the data statistic information includes a timestamp and a device identifier, and the target statistic information obtaining unit 602 may include: a data alignment subunit (not shown in the figure) and a second target statistical information acquisition subunit (not shown in the figure). The data alignment subunit, in response to that the number of the at least one service node is multiple, is configured to perform data alignment on data statistics information sent by multiple service nodes to obtain initial statistics information; a second target statistical information obtaining subunit, configured to process the initial statistical information according to a second set condition, to obtain target statistical information, where the second set condition includes at least one of: timestamp, device identification, application name.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
As shown in fig. 7, the electronic device is 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 examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 7, the electronic apparatus includes: one or more processors 701, a memory 702, and interfaces for connecting the various components, including a high-speed interface and a low-speed interface. 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 for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 7, one processor 701 is taken as an example.
The memory 702 is a non-transitory computer readable storage medium as provided herein. The memory stores instructions executable by the at least one processor, so that the at least one processor performs the method for acquiring information provided by the present application. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the method for obtaining information provided herein.
The memory 702, which is a non-transitory computer-readable storage medium, may be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions/modules corresponding to the method for acquiring information in the embodiments of the present application (for example, the thread generating unit 501, the information processing unit 502, and the recording information acquiring unit 503 shown in fig. 5). 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 executing the non-transitory software programs, instructions, and modules stored in the memory 702.
The memory 702 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the electronic device of the method for acquiring information, and the like. Further, 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, the memory 702 may optionally include memory located remotely from the processor 701, which may be connected through a network to an electronic device for use in a method of retrieving information. 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 of the method for 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 other means, and fig. 7 illustrates an example of a connection by a bus.
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 apparatus used to acquire the information, such as an input device like 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, etc. The output devices 704 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibrating 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 can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. 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 a pointing device (e.g., a mouse or a 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 can 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, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end 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 back-end, 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 clients and servers. A client and server are generally 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, the first thread and the second thread are generated 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 perform data processing on the data processing request, and the second thread is controlled to record the data processing information of the first thread, so that normal data processing of the first thread on the data processing request can be guaranteed, and the data processing information of the first thread can be monitored in real time through the second thread; and finally, when a data processing completion signal corresponding to the first thread is detected, the information acquired by the second thread is marked as recording information, and the recording information is acquired under the condition of not adding extra hardware or software.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (16)

1. A method for obtaining information, comprising:
generating a first thread and a second thread in response to detecting a data processing request;
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;
and in response to detecting a data processing completion signal corresponding to the first thread, marking the information collected by the second thread as recorded information.
2. The method of claim 1, wherein the logging information comprises at least one of: application name, number of requests, request time, data result generation time, and
the method further comprises the following steps:
storing the recording information into local recording information, wherein the local recording information stores historical recording information of current equipment within a set time range;
and carrying out classified statistics on the information in the local recording information to obtain data statistical information corresponding to the current equipment, wherein the data statistical information comprises a timestamp and an equipment identifier.
3. The method of claim 2, wherein the method comprises:
and sending the data statistical information to a control node according to a set time period.
4. The method of claim 3, wherein the method comprises:
and deleting the local record information in response to detecting an information transmission success signal sent by the control node.
5. A method for obtaining information, 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 in a set time of the service node;
and performing data processing on the at least one piece of data statistical information to obtain target statistical information.
6. The method of claim 5, wherein the data processing the at least one piece of data statistics to obtain target statistics comprises:
and responding to the condition that the number of the at least one service node is one, and processing the data statistical information according to a first set condition to obtain target statistical information.
7. The method of claim 5, wherein the data statistics include a timestamp and a device identification, and
the data processing of the at least one piece of data statistical information to obtain target statistical information includes:
responding to the number of the at least one service node being multiple, and performing data alignment on data statistical information sent by the multiple service nodes to obtain initial statistical 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 items: timestamp, device identification, application name.
8. An apparatus for obtaining information, 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;
a record information acquisition unit configured to mark information collected by the second thread as record information in response to detecting a data processing completion signal corresponding to the first thread.
9. The apparatus of claim 8, wherein the logging information comprises at least one of: application name, number of requests, request time, 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 a current device within a set time range;
and the data statistical information acquisition unit is configured to perform classified statistics on information in the local recording information to obtain data statistical information corresponding to the current equipment, wherein the data statistical information comprises a timestamp and an equipment identifier.
10. The apparatus of claim 9, wherein 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.
11. The apparatus of claim 10, wherein the apparatus comprises:
and the information deleting unit is used for responding to the detection of the information transmission success signal sent by the control node and deleting the local record information.
12. An apparatus for obtaining information, comprising:
the information receiving unit is configured to receive at least one piece of data statistical information sent by at least one service node, wherein the data statistical information comprises data processing information in 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.
13. The apparatus of claim 12, wherein the target statistical information obtaining unit comprises:
and the first target statistical information acquisition subunit, in response to the number of the at least one service node being one, is configured to process the data statistical information according to a first set condition to obtain target statistical information.
14. The apparatus of claim 12, wherein the data statistics comprise a timestamp and a device identification, and
the target statistical information acquisition unit includes:
the data alignment subunit is used for responding to the condition that the number of the at least one service node is multiple, and performing data alignment on data statistical information sent by the multiple service nodes to obtain initial statistical information;
a second target statistical information obtaining subunit, configured to process the initial statistical information according to a second set condition, to obtain target statistical information, where the second set condition includes at least one of: timestamp, device identification, application name.
15. 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-4 or the method of any of claims 5-7.
16. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method of any one of claims 1 to 4 or the method of any one of claims 5 to 7.
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 true CN111597026A (en) 2020-08-28
CN111597026B 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)

Cited By (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 (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020188590A1 (en) * 2001-06-06 2002-12-12 International Business Machines Corporation Program support for disk fencing in a shared disk parallel file system across storage area network
CN102819478A (en) * 2012-07-20 2012-12-12 中国科学院西安光学精密机械研究所 Agent-free data processing system monitoring and management method
CN103533572A (en) * 2013-10-24 2014-01-22 广东欧珀移动通信有限公司 WIFI performance automation testing method and device
CN103559219A (en) * 2013-10-18 2014-02-05 北京京东尚科信息技术有限公司 Distributed web crawler capture task dispatching method, dispatching-side device and capture nodes
CN105700938A (en) * 2016-01-15 2016-06-22 浪潮通用软件有限公司 Multithread processing data method and device
CN106227583A (en) * 2016-07-18 2016-12-14 青岛科信安全技术有限公司 A kind of multiple thread video Real-time Data Processing Method and device
CN106569729A (en) * 2015-10-09 2017-04-19 阿里巴巴集团控股有限公司 Method and device for writing in data in distributed system
US20180067533A1 (en) * 2014-12-23 2018-03-08 Intel Corporation Systems and methods for synergistic software-hardware power budget management
CN108549586A (en) * 2018-04-17 2018-09-18 百度在线网络技术(北京)有限公司 Information processing method and device
CN109741743A (en) * 2019-01-10 2019-05-10 深圳市江波龙电子股份有限公司 A kind of control method and device of equipment, non-volatile memory medium
CN110046187A (en) * 2018-12-25 2019-07-23 阿里巴巴集团控股有限公司 Data processing system, method and device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020188590A1 (en) * 2001-06-06 2002-12-12 International Business Machines Corporation Program support for disk fencing in a shared disk parallel file system across storage area network
CN102819478A (en) * 2012-07-20 2012-12-12 中国科学院西安光学精密机械研究所 Agent-free data processing system monitoring and management method
CN103559219A (en) * 2013-10-18 2014-02-05 北京京东尚科信息技术有限公司 Distributed web crawler capture task dispatching method, dispatching-side device and capture nodes
CN103533572A (en) * 2013-10-24 2014-01-22 广东欧珀移动通信有限公司 WIFI performance automation testing method and device
US20180067533A1 (en) * 2014-12-23 2018-03-08 Intel Corporation Systems and methods for synergistic software-hardware power budget management
CN106569729A (en) * 2015-10-09 2017-04-19 阿里巴巴集团控股有限公司 Method and device for writing in data in distributed system
CN105700938A (en) * 2016-01-15 2016-06-22 浪潮通用软件有限公司 Multithread processing data method and device
CN106227583A (en) * 2016-07-18 2016-12-14 青岛科信安全技术有限公司 A kind of multiple thread video Real-time Data Processing Method and device
CN108549586A (en) * 2018-04-17 2018-09-18 百度在线网络技术(北京)有限公司 Information processing method and device
CN110046187A (en) * 2018-12-25 2019-07-23 阿里巴巴集团控股有限公司 Data processing system, method and device
CN109741743A (en) * 2019-01-10 2019-05-10 深圳市江波龙电子股份有限公司 A kind of control method and device of equipment, non-volatile memory medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
MATTHEW L MASSIE 等: "The ganglia distributed monitoring system: design, implementation, and experience", 《PARALLEL COMPUTING》, vol. 30, no. 7, pages 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)》, pages 259 - 268 *
张伟: "分布式数据采集分析***的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》, no. 02, pages 140 - 1082 *

Cited By (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

Also Published As

Publication number Publication date
CN111597026B (en) 2023-06-30

Similar Documents

Publication Publication Date Title
CN111753997B (en) Distributed training method, system, device 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
CN111858248A (en) Application monitoring method, device, equipment and storage medium
CN111694646A (en) Resource scheduling method and device, electronic equipment and computer readable storage medium
US11722371B2 (en) Utilizing unstructured data in self-organized networks
CN113051043A (en) Micro-service anomaly compensation method and device
CN111782147A (en) Method and apparatus for cluster scale-up
CN112491617A (en) Link tracking method, device, electronic equipment and medium
CN111865720A (en) Method, apparatus, device and storage medium for processing request
US20170046071A1 (en) Selecting a primary storage device
CN111581049B (en) Distributed system running state monitoring method, device, equipment and storage medium
CN111726402B (en) User behavior data processing method and device, electronic equipment and storage medium
CN111597026B (en) Method and device for acquiring information
CN110750419B (en) Offline task processing method and device, electronic equipment and storage medium
CN112084000A (en) Container cluster testing method and device
CN111835857B (en) Method and apparatus for accessing data
CN112671665B (en) Intelligent traffic scheduling method, device, equipment and storage medium
CN112735601A (en) Test method, device and equipment for determining infectious disease close-contact population by using Bluetooth
CN113032209A (en) Operation monitoring method, device, server and medium
CN112099933A (en) Task operation and query method and device, electronic equipment and storage medium
CN112016059A (en) Method, apparatus, device and storage medium for processing data
CN113778973A (en) Data storage method and device
CN112437152B (en) Crash processing method and device, electronic equipment and storage medium
CN111694686A (en) Abnormal service processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant