CN111309694A - Log file acquisition method, server, device and system - Google Patents

Log file acquisition method, server, device and system Download PDF

Info

Publication number
CN111309694A
CN111309694A CN201811518400.6A CN201811518400A CN111309694A CN 111309694 A CN111309694 A CN 111309694A CN 201811518400 A CN201811518400 A CN 201811518400A CN 111309694 A CN111309694 A CN 111309694A
Authority
CN
China
Prior art keywords
database
test
log file
log
test device
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.)
Pending
Application number
CN201811518400.6A
Other languages
Chinese (zh)
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 Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo 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 Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201811518400.6A priority Critical patent/CN111309694A/en
Publication of CN111309694A publication Critical patent/CN111309694A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method, a server, a device, a system, electronic equipment and a computer readable storage medium for acquiring a log file. The method comprises the following steps: when receiving the message of test equipment test end, issuing the log acquisition request of the test equipment to an intermediary database; monitoring whether a log file corresponding to the test equipment exists in an intermediary database; and when the log file corresponding to the test equipment is monitored in the intermediate database, acquiring the log file. Acquiring log files corresponding to all test devices in a router; monitoring whether a journal acquisition request corresponding to each test device exists in an intermediary database; when a log acquisition request of a test device in the intermediate database is monitored, a log file corresponding to the test device is issued to the intermediate database according to the log acquisition request. Even if the server and the router are in a cross-network segment, the test server can also obtain the log file in the router, and the test of the application statistical function of the router is realized.

Description

Log file acquisition method, server, device and system
Technical Field
The invention relates to the technical field of computers, in particular to a method, a server, a device, a system, electronic equipment and a computer readable storage medium for acquiring a log file.
Background
When the log file is obtained, the log file cannot be obtained between devices using different network segments for surfing the internet, for example, when the application duration counting function of the router is tested, the router adopts the first network segment for surfing the internet, the test server adopts the second network segment for surfing the internet, and the first network segment and the second network segment are not intersected, so that the test server cannot obtain the application duration counted by the router, and cannot complete the test of the application duration counting function of the router. Therefore, a scheme for acquiring log files across network segments is urgently needed.
Disclosure of Invention
In view of the above, the present invention has been made to provide a log file acquisition method, a server, an apparatus, a system, an electronic device, and a computer-readable storage medium that overcome or at least partially solve the above problems.
According to an aspect of the present invention, there is provided a method for acquiring a log file, wherein the method includes:
when receiving a message of test equipment test completion, issuing a log acquisition request of the test equipment to an intermediary database;
monitoring whether a log file corresponding to the test equipment exists in the intermediate database;
and when the log file corresponding to the test equipment is monitored in the intermediate database, acquiring the log file.
Optionally, the intermediary database is a Redis database;
the issuing of the log acquisition request of the test device to the intermediary database includes: issuing a log acquisition request of the test equipment to a first channel corresponding to the test equipment in a Redis database;
the monitoring whether the intermediate database has the log file corresponding to the test device includes: subscribing a second channel corresponding to the test equipment in the Redis database; when data exist in the second channel, determining that a log file corresponding to the testing equipment exists in the Redis database;
the first channels correspond to the second channels one to one.
Optionally, the first frequency channel and the second frequency channel are identified according to a MAC address of the testing device.
Optionally, the intermediary database is a Mysql database;
the issuing of the log acquisition request of the test device to the intermediary database includes: issuing a log acquisition request of the test equipment to a first field corresponding to the test equipment in a specified data table of a Mysql database;
the monitoring whether the intermediate database has the log file corresponding to the test device includes: polling and monitoring whether data exist in a second field corresponding to the test equipment in a specified data table of the Mysql database; and when the data in the second field is monitored, determining that the log file corresponding to the test equipment exists in the Mysql database.
Optionally, the polling and monitoring whether there is data in a second field corresponding to the test device in a specified data table of the Mysql database includes:
setting a preset time or a preset frequency;
and inquiring whether data exist in a second field corresponding to the test equipment in a specified data table of the Mysql database at preset time intervals or according to preset frequency.
Optionally, the first field and the second field corresponding to each test device in the specified data table specifically correspond to the MAC address of the test device.
Optionally, the method further comprises:
and judging whether the use duration of each application in the acquired log file is consistent with the preset duration in the corresponding test case, and if so, passing the test.
According to another aspect of the present invention, there is provided a method for acquiring a log file, wherein the method includes:
acquiring log files corresponding to all test devices in a router;
monitoring whether a journal acquisition request corresponding to each test device exists in an intermediary database;
when a log acquisition request of a test device in the intermediate database is monitored, a log file corresponding to the test device is issued to the intermediate database according to the log acquisition request.
Optionally, the intermediary database is a Redis database;
whether the monitoring intermediary database has log acquisition requests corresponding to the test devices or not comprises the following steps: subscribing a first channel corresponding to each testing device in a Redis database; when data exist in a first channel corresponding to one testing device, determining that a log acquisition request corresponding to the testing device exists in the Redis database;
the publishing the log file corresponding to the test device to the intermediary database comprises: the log file corresponding to the test equipment is issued to a second channel corresponding to the test equipment in the Redis database;
the first channels correspond to the second channels one to one.
Optionally, the first frequency channel and the second frequency channel are identified according to a MAC address of the testing device.
Optionally, the intermediary database is a Mysql database;
whether the monitoring intermediary database has log acquisition requests corresponding to the test devices or not comprises the following steps: polling and monitoring whether data exist in a first field corresponding to each test device in an appointed data table of the Mysql database; when monitoring that data exist in a first field corresponding to one testing device in an appointed data table, determining that a log acquisition request corresponding to the testing device exists in the Mysql database;
the publishing the log file corresponding to the test device to the intermediary database comprises: and issuing the log file corresponding to the test equipment to a second field corresponding to the test equipment in a specified data table of the Mysql database.
Optionally, the polling and monitoring whether there is data in a first field corresponding to each test device in a specified data table of the Mysql database includes:
setting a preset time or a preset frequency;
and inquiring whether data exist in a first field corresponding to the test equipment in a specified data table of the Mysql database at preset time intervals or according to a preset frequency.
Optionally, the first field and the second field corresponding to each test device in the specified data table specifically correspond to the MAC address of the test device.
Optionally, the method further comprises:
analyzing the obtained log files corresponding to the test equipment; obtaining the service time of each application corresponding to each test device;
the publishing the log file corresponding to the test device to the intermediary database comprises: and issuing the obtained service duration of each application corresponding to the test equipment to the intermediary database as a log file corresponding to the test equipment.
According to another aspect of the present invention, there is provided a log file obtaining server, wherein the server includes:
the release unit is suitable for releasing the log acquisition request of the test equipment to the intermediary database when receiving a message of test equipment test completion;
the monitoring unit is suitable for monitoring whether the log file corresponding to the test equipment exists in the intermediate database;
and the acquisition unit is suitable for acquiring the log file when the log file corresponding to the test equipment is monitored in the intermediate database.
Optionally, the intermediary database is a Redis database;
the release unit is suitable for releasing the log acquisition request of the test equipment to a first channel corresponding to the test equipment in a Redis database;
the monitoring unit is suitable for subscribing a second channel corresponding to the testing equipment in a Redis database; when data exist in the second channel, determining that a log file corresponding to the testing equipment exists in the Redis database;
the first channels correspond to the second channels one to one.
Optionally, the first frequency channel and the second frequency channel are identified according to a MAC address of the testing device.
Optionally, the intermediary database is a Mysql database;
the release unit is suitable for releasing the log acquisition request of the test equipment to a first field corresponding to the test equipment in a specified data table of the Mysql database;
the monitoring unit is suitable for polling and monitoring whether data exist in a second field corresponding to the test equipment in an appointed data table of the Mysql database; and when the data in the second field is monitored, determining that the log file corresponding to the test equipment exists in the Mysql database.
Alternatively,
the monitoring unit is suitable for setting preset time or preset frequency; and inquiring whether data exist in a second field corresponding to the test equipment in a specified data table of the Mysql database at preset time intervals or according to preset frequency.
Optionally, the first field and the second field corresponding to each test device in the specified data table specifically correspond to the MAC address of the test device.
Optionally, the server further comprises:
and the judging unit is suitable for judging whether the use time length of each application in the acquired log file is consistent with the preset time length in the corresponding test case or not, and if so, the test is passed.
According to still another aspect of the present invention, there is provided an apparatus for acquiring a log file, wherein the apparatus includes:
the acquisition unit is suitable for acquiring log files corresponding to all the test devices in the router;
the monitoring unit is suitable for monitoring whether the intermediate database has log acquisition requests corresponding to the test equipment;
the issuing unit is suitable for issuing a log file corresponding to a test device to the intermediary database according to a log obtaining request when the log obtaining request of the test device in the intermediary database is monitored.
Optionally, the intermediary database is a Redis database;
the monitoring unit is suitable for subscribing a first channel corresponding to each testing device in a Redis database; when data exist in a first channel corresponding to one testing device, determining that a log acquisition request corresponding to the testing device exists in the Redis database;
the release unit is suitable for releasing the log file corresponding to the test equipment to a second channel corresponding to the test equipment in the Redis database;
the first channels correspond to the second channels one to one.
Optionally, the first frequency channel and the second frequency channel are identified according to a MAC address of the testing device.
Optionally, the intermediary database is a Mysql database;
the monitoring unit is suitable for polling and monitoring whether data exist in the first fields corresponding to the test equipment in the specified data table of the Mysql database; when monitoring that data exist in a first field corresponding to one testing device in an appointed data table, determining that a log acquisition request corresponding to the testing device exists in the Mysql database;
the publishing unit is suitable for publishing the log file corresponding to the test device to a second field corresponding to the test device in a specified data table of the Mysql database.
Alternatively,
the monitoring unit is suitable for setting preset time or preset frequency; and inquiring whether data exist in a first field corresponding to the test equipment in a specified data table of the Mysql database at preset time intervals or according to a preset frequency.
Optionally, the first field and the second field corresponding to each test device in the specified data table specifically correspond to the MAC address of the test device.
Optionally, the apparatus further comprises:
the analysis unit is suitable for analyzing the acquired log files corresponding to the test equipment; obtaining the service time of each application corresponding to each test device;
the issuing unit is adapted to issue the obtained usage duration of each application corresponding to the test device to the intermediary database as a log file corresponding to the test device.
According to still another aspect of the present invention, there is provided a log file acquiring system, wherein the system includes the server as described above, the device as described above, and the intermediary database.
According to still another aspect of the present invention, there is provided an electronic apparatus, wherein the electronic apparatus includes:
a processor; and the number of the first and second groups,
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform a method according to the foregoing.
According to yet another aspect of the present invention, there is provided a computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement the aforementioned method.
According to the technical scheme of the invention, when the test server receives the message of test equipment test completion, the test server issues the log acquisition request of the test equipment to the intermediary database; monitoring whether a log file corresponding to the test equipment exists in an intermediary database; and when the log file corresponding to the test equipment is monitored in the intermediate database, acquiring the log file. The log file acquisition device acquires log files corresponding to all test equipment in the router; monitoring whether a journal acquisition request corresponding to each test device exists in an intermediary database; when a log acquisition request of a test device in the intermediate database is monitored, a log file corresponding to the test device is issued to the intermediate database according to the log acquisition request. Therefore, according to the technical scheme, through the combination of the device and the intermediate database, even if the test server and the router are in a cross-network segment, the test server can acquire the log file in the router, and further the test of the application statistical function of the router is realized.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flowchart illustrating a method for obtaining a log file according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a log file acquisition method according to another embodiment of the present invention;
FIG. 3 is a diagram illustrating a configuration of a log file acquisition server according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of an apparatus for acquiring a log file according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a log file acquisition system according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a log file acquisition system according to another embodiment of the present invention;
FIG. 7 shows a schematic structural diagram of an electronic device according to one embodiment of the invention;
fig. 8 illustrates a schematic structural diagram of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 is a schematic flow chart of a log file acquisition method according to an embodiment of the present invention, which illustrates the present technical solution from a server side. As shown in fig. 1, the method includes:
step S110, when receiving the message of the test device ending, issuing the log obtaining request of the test device to the intermediary database.
In this embodiment, the server is connected to the test device, so as to control the test device to execute the test case, and obtain the test device information. And the test equipment informs the server after executing the test case.
Step S120, monitoring whether there is a log file corresponding to the testing device in the intermediary database.
In this embodiment, the server determines whether there is a log file corresponding to the test device in the intermediate database in a monitoring manner.
Step S130, when a log file corresponding to the test device is monitored in the intermediate database, the log file is obtained.
Therefore, according to the technical scheme, through the combination of the device and the intermediate database, even if the server and the router are in a cross-network segment, the server can acquire the log file in the router, and further the test of the application statistical function of the router is realized.
In this technical solution, the broker database may adopt a Redis database and a Mysql database, and different broker databases have different characteristics, so that the execution mode of this technical solution is also different, and the following detailed description is provided.
In one embodiment of the invention, the intermediary database is a Redis database.
Issuing the log acquisition request of the test device to the broker database in step S110 of the method shown in fig. 1 includes: and issuing the log acquisition request of the test equipment to a first channel corresponding to the test equipment in a Redis database.
The step S120 of the method shown in fig. 1 includes that whether the log file corresponding to the test device exists in the database of the monitoring intermediary: subscribing a second channel corresponding to the test equipment in the Redis database; and when the second channel has data, determining that the log file corresponding to the test equipment exists in the Redis database.
The first channels correspond to the second channels one to one.
In this embodiment, the broker database is a Redis database, and the server may subscribe to a channel of the Redis database by using a subscription and publishing function of the Redis database, so as to determine whether there is a log file in the Redis database.
And the first channel in the Redis database is used as a channel for the log acquisition request, and the second channel is used as a channel for the log file. Thus, the server subscribing to the second channel in the Redis database can determine whether the log file of the corresponding test device exists in the Redis database.
In practical application, one test device corresponds to one first channel in a Redis database, a plurality of test devices need a plurality of first channels in the Redis database, and each test device corresponds to one first channel; one test device corresponds to one second channel in the Redis database, a plurality of test devices need a plurality of second channels in the Redis database, and each test device corresponds to one second channel. Furthermore, the first channel and the second channel of a test device are in one-to-one correspondence. For example, the test device 1 and the test device 2, the first channel 1 and the second channel 1 in the Redis database correspond to the test device 1, and the first channel 2 and the second channel 2 correspond to the test device 2. When the server issues the log obtaining request, the log obtaining request of the testing device 1 is issued to the first channel 1, and the log obtaining request of the testing device 2 is issued to the first channel 2. And subscribing a second channel 1 and a second channel 2, acquiring the log file of the test equipment 1 when the log file is in the second channel 1, and acquiring the log file of the test equipment 2 when the log file is in the second channel 2.
Further, the first frequency channel and the second frequency channel are identified according to the MAC address of the test device.
In order to make the first frequency channel and the second frequency channel uniquely identifiable, the identification may be performed using the MAC address of the corresponding test device. The MAC Address (Media Access Control Address) is translated into a Media Access Control Address, also called a local area network Address (LAN Address), an Ethernet Address (Ethernet Address) or a physical Address (physical Address), which is an Address for confirming the location of the devices on the network, that is, the MAC Address corresponding to each test device is unique.
For example, the first channel 1 corresponding to test device 1 in the Redis database is MAC1, the second channel 1 is MAC1_ R; the second channel 2 is the MAC2_ R corresponding to the first channel MAC2 of the test device 2.
In one embodiment of the invention, the intermediary database is a Mysql database;
issuing the log acquisition request of the test device to the broker database in step S110 of the method shown in fig. 1 includes: and issuing the log acquisition request of the test equipment to a first field corresponding to the test equipment in a specified data table of the Mysql database.
The step S120 of the method shown in fig. 1 includes that whether the log file corresponding to the test device exists in the database of the monitoring intermediary: polling and monitoring whether data exist in a second field corresponding to the test equipment in a specified data table of the Mysql database; and when the data in the second field is monitored, determining that the log file corresponding to the test equipment exists in the Mysql database.
In this embodiment, the broker database is a Mysql database, which has no subscription and publishing functions of the Redis database, and is therefore implemented in the form of a created table. And creating a table in the Mysql database, wherein each row of the table represents a test device, a corresponding first field is used as a field of the log acquisition request, and a second field is used as a field of the log file. Thus, the server queries the second field in the Mysql database to determine whether there is a log file for the corresponding test device in the Mysql database.
Table 1 shows a table in the Mysql database of one embodiment of the invention. As shown in table 1, the MACs 1-3 correspond to the testing devices 1-3, respectively, and when the server receives a message that the testing device 1 finishes testing, the server issues a log obtaining request of the testing device 1 to the first field corresponding to the MAC1 in table 1, polls whether data exists in the second field of the MAC1, and when data exists in the second field, obtains the data in the second field, that is, obtains the log file of the testing device 1.
TABLE 1
Test equipment identification First field Second field
MAC1
MAC2
MAC3
Further, the polling and monitoring whether data exists in a second field corresponding to the test device in the specified data table of the Mysql database includes: setting a preset time or a preset frequency; and inquiring whether data exist in a second field corresponding to the test equipment in a specified data table of the Mysql database at preset time intervals or according to preset frequency.
In this embodiment, polling is performed by setting a preset time or a preset frequency. For example, the frequency is set every 10 minutes, or the preset time is set to 0 point, 1 point, 2 points, or the like.
Further, the first field and the second field corresponding to each test device in the specified data table specifically correspond to the MAC address of the test device.
In order to make the first field and the second field corresponding to each testing device uniquely identified, the MAC address of the corresponding testing device may be used for identification. For example, what corresponds to test device 1 as in table 1 is MAC 1; corresponding to test device 2 is MAC 2; corresponding to test device 3 is MAC 3.
In one embodiment of the present invention, the method shown in fig. 1 further comprises:
and judging whether the use duration of each application in the acquired log file is consistent with the preset duration in the corresponding test case, and if so, passing the test.
Therefore, in this embodiment, whether the usage duration of each application in the acquired log file is consistent with the preset duration in the corresponding test case is determined by the server, so as to test whether the application duration statistical function of the router is accurate.
Fig. 2 is a schematic flow chart of a log file acquisition method according to another embodiment of the present invention, which illustrates the present technical solution from the device side. As shown in fig. 2, the method includes:
step S210, a log file corresponding to each test device in the router is obtained.
In this embodiment, the log file acquiring device and the router adopt the same network segment for accessing the internet, and are connected with the router for acquiring the log file in the router.
Step S220, monitoring whether there is a log obtaining request corresponding to each testing device in the intermediary database.
In order to determine the time for issuing the log file to the intermediary database, it is necessary to monitor whether there is a log acquisition request corresponding to each test device in the intermediary data.
In step S230, when a log obtaining request of a testing device in the intermediate database is monitored, a log file corresponding to the testing device is issued to the intermediate database according to the log obtaining request.
When there is a log obtaining request of the test device in the intermediate database, it indicates that the test device has been tested, and may release the log file to the intermediate database, so that the test server may obtain the log file of the test device that has been tested from the intermediate database.
Therefore, according to the technical scheme, through the combination of the device and the intermediate database, even if the test server and the router are in a cross-network segment, the test server can acquire the log file in the router, and further the test of the application statistical function of the router is realized.
In this technical solution, the broker database may adopt a Redis database and a Mysql database, and different broker databases have different characteristics, so that the execution mode of this technical solution is also different, and the following detailed description is provided.
In one embodiment of the invention, the intermediary database is a Redis database;
in step S220 of the method shown in fig. 2, the step of monitoring whether there is a log obtaining request corresponding to each test device in the intermediary database includes: subscribing a first channel corresponding to each testing device in a Redis database; when data exist in a first channel corresponding to one testing device, determining that a log acquisition request corresponding to the testing device exists in a Redis database.
The publishing of the log file corresponding to the test device to the intermediary database in step S230 of the method shown in fig. 2 includes: and issuing the log file corresponding to the test device to a second channel corresponding to the test device in a Redis database.
The first channels correspond to the second channels one to one.
In this embodiment, the broker database is a Redis database, and the test server may subscribe to a channel of the Redis database by using a subscription and publishing function of the Redis database, so as to determine whether there is a log file in the Redis database.
And the first channel in the Redis database is used as a channel for the log acquisition request, and the second channel is used as a channel for the log file. Thus, the test server subscribes to the second channel in the Redis database to determine whether the log file of the corresponding test device exists in the Redis database.
In practical application, one test device corresponds to one first channel in a Redis database, a plurality of test devices need a plurality of first channels in the Redis database, and each test device corresponds to one first channel; one test device corresponds to one second channel in the Redis database, a plurality of test devices need a plurality of second channels in the Redis database, and each test device corresponds to one second channel. Furthermore, the first channel and the second channel of a test device are in one-to-one correspondence. For example, the test device 1 and the test device 2, the first channel 1 and the second channel 1 in the Redis database correspond to the test device 1, and the first channel 2 and the second channel 2 correspond to the test device 2. The log file acquisition device subscribes to a first channel of each test device. When a first channel 1 of the test equipment 1 has a log obtaining request, a log file of the test equipment 1 is issued to a second channel of the test equipment 1; when the first channel 1 of the test device 2 has a log obtaining request, the log file of the test device 2 is issued to the second channel of the test device 2.
Further, the first frequency channel and the second frequency channel are identified according to the MAC address of the test device.
In order to make the first frequency channel and the second frequency channel uniquely identifiable, the identification may be performed using the MAC address of the corresponding test device. The MAC Address (Media Access Control Address) is translated into a Media Access Control Address, also called a local area network Address (LAN Address), an Ethernet Address (Ethernet Address) or a physical Address (physical Address), which is an Address for confirming the location of the devices on the network, that is, the MAC Address corresponding to each test device is unique.
For example, the first channel 1 corresponding to test device 1 in the Redis database is MAC1, the second channel 1 is MAC1_ R; the second channel 2 is the MAC2_ R corresponding to the first channel MAC2 of the test device 2.
In one embodiment of the invention, the intermediary database is a Mysql database;
in step S220 of the method shown in fig. 2, the step of monitoring whether there is a log obtaining request corresponding to each test device in the intermediary database includes: polling and monitoring whether data exist in a first field corresponding to each test device in an appointed data table of the Mysql database; when data in a first field corresponding to one testing device in the specified data table is monitored, determining that a log acquisition request corresponding to the testing device exists in the Mysql database.
The publishing of the log file corresponding to the test device to the intermediary database in step S230 of the method shown in fig. 2 includes: and issuing the log file corresponding to the test equipment to a second field corresponding to the test equipment in a specified data table of the Mysql database.
In this embodiment, the broker database is a Mysql database, which has no subscription and publishing functions of the Redis database, and is therefore implemented in the form of a created table. And creating a table in the Mysql database, wherein each row of the table represents a test device, a corresponding first field is used as a field of the log acquisition request, and a second field is used as a field of the log file. Therefore, the log file acquiring device can determine whether the Mysql database has a log acquiring request of the corresponding test equipment by inquiring the first field in the Mysql database, and the log file is issued to the second field of the corresponding test equipment so as to be inquired by the server.
As shown in table 1, the MACs 1-3 correspond to the testing devices 1-3, respectively, the log file obtaining device polls the first field of the testing device 1, that is, the MAC1, when there is a log obtaining request in the first field of the MAC1, the log file of the testing device 1 is issued to the second field of the slave MAC1, the server polls whether there is data in the second field of the MAC1, and when there is data in the second field, the data in the second field is obtained, that is, the log file of the testing device 1 is obtained.
Further, the polling and monitoring whether there is data in the first field corresponding to each test device in the specified data table of the Mysql database includes: setting a preset time or a preset frequency; and inquiring whether data exist in a first field corresponding to the test equipment in a specified data table of the Mysql database at preset time intervals or according to a preset frequency.
In this embodiment, polling is performed by setting a preset time or a preset frequency. For example, the frequency is set every 10 minutes, or the preset time is set to 0 point, 1 point, 2 points, or the like.
Further, the first field and the second field corresponding to each test device in the specified data table specifically correspond to the MAC address of the test device.
In order to make the first field and the second field corresponding to each testing device uniquely identified, the MAC address of the corresponding testing device may be used for identification. For example, what corresponds to test device 1 as in table 1 is MAC 1; corresponding to test device 2 is MAC 2; corresponding to test device 3 is MAC 3.
In one embodiment of the present invention, the method shown in fig. 2 further comprises: analyzing the obtained log files corresponding to the test equipment; and obtaining the service life of each application corresponding to each test device.
The publishing of the log file corresponding to the test device to the intermediary database in step S230 of the method shown in fig. 2 includes: and issuing the obtained use duration of each application corresponding to the test equipment to an intermediary database as a log file corresponding to the test equipment.
When monitoring a log acquisition request of a test device, the device analyzes a log file of the test device to obtain the use duration of each application corresponding to the test device, and issues the use duration of each application corresponding to the test device to the intermediate database, wherein the use duration of each application in the log file is counted by the application duration counting function of the router, so that when the server acquires the log file, whether the use duration of each application in the acquired log file is consistent with the preset duration in a corresponding test case can be judged, and if the use duration of each application in the acquired log file is consistent with the preset duration in the corresponding test case, the test is passed.
Fig. 3 is a schematic structural diagram of an acquisition server of a log file according to an embodiment of the present invention. As shown in fig. 3, the log file obtaining server 300 includes:
the issuing unit 310 is adapted to issue the log obtaining request of the testing device to the intermediary database when receiving the message that the testing device finishes testing.
In this embodiment, the server is connected to the test device, so as to control the test device to execute the test case, and obtain the test device information. And the test equipment informs the server after executing the test case. The server here includes a web server.
The monitoring unit 320 is adapted to monitor whether there is a log file corresponding to the testing device in the intermediary database.
In this embodiment, the server determines whether there is a log file corresponding to the test device in the intermediate database in a monitoring manner.
The obtaining unit 330 is adapted to obtain the log file when the log file corresponding to the test device is monitored in the intermediate database.
Therefore, according to the technical scheme, through the combination of the device and the intermediate database, even if the server and the router are in a cross-network segment, the server can acquire the log file in the router, and further the test of the application statistical function of the router is realized.
In this technical solution, the broker database may adopt a Redis database and a Mysql database, and different broker databases have different characteristics, so that the execution mode of this technical solution is also different, and the following detailed description is provided.
In one embodiment of the invention, the intermediary database is a Redis database.
The issuing unit 310 is adapted to issue the log obtaining request of the test device to the first channel corresponding to the test device in the Redis database.
The monitoring unit 320 is adapted to subscribe to a second channel corresponding to the test device in the Redis database; and when the second channel has data, determining that the log file corresponding to the test equipment exists in the Redis database.
The first channels correspond to the second channels one to one.
In this embodiment, the broker database is a Redis database, and the server may subscribe to a channel of the Redis database by using a subscription and publishing function of the Redis database, so as to determine whether there is a log file in the Redis database.
And the first channel in the Redis database is used as a channel for the log acquisition request, and the second channel is used as a channel for the log file. Thus, the server subscribing to the second channel in the Redis database can determine whether the log file of the corresponding test device exists in the Redis database.
In practical application, one test device corresponds to one first channel in a Redis database, a plurality of test devices need a plurality of first channels in the Redis database, and each test device corresponds to one first channel; one test device corresponds to one second channel in the Redis database, a plurality of test devices need a plurality of second channels in the Redis database, and each test device corresponds to one second channel. Furthermore, the first channel and the second channel of a test device are in one-to-one correspondence. For example, the test device 1 and the test device 2, the first channel 1 and the second channel 1 in the Redis database correspond to the test device 1, and the first channel 2 and the second channel 2 correspond to the test device 2. When the server issues the log obtaining request, the log obtaining request of the testing device 1 is issued to the first channel 1, and the log obtaining request of the testing device 2 is issued to the first channel 2. And subscribing a second channel 1 and a second channel 2, acquiring the log file of the test equipment 1 when the log file is in the second channel 1, and acquiring the log file of the test equipment 2 when the log file is in the second channel 2.
Further, the first frequency channel and the second frequency channel are identified according to the MAC address of the test device.
In order to make the first frequency channel and the second frequency channel uniquely identifiable, the identification may be performed using the MAC address of the corresponding test device. The MAC Address (Media Access Control Address) is translated into a Media Access Control Address, also called a local area network Address (LAN Address), an Ethernet Address (Ethernet Address) or a physical Address (physical Address), which is an Address for confirming the location of the devices on the network, that is, the MAC Address corresponding to each test device is unique.
For example, the first channel 1 corresponding to test device 1 in the Redis database is MAC1, the second channel 1 is MAC1_ R; the second channel 2 is the MAC2_ R corresponding to the first channel MAC2 of the test device 2.
In one embodiment of the invention, the intermediary database is a Mysql database.
The issuing unit 310 is adapted to issue the log obtaining request of the test device to a first field corresponding to the test device in a specified data table of the Mysql database.
The monitoring unit 320 is adapted to monitor whether data exists in a second field corresponding to the test equipment in a specified data table of the Mysql database in a polling manner; and when the data in the second field is monitored, determining that the log file corresponding to the test equipment exists in the Mysql database.
In this embodiment, the broker database is a Mysql database, which has no subscription and publishing functions of the Redis database, and is therefore implemented in the form of a created table. And creating a table in the Mysql database, wherein each row of the table represents a test device, a corresponding first field is used as a field of the log acquisition request, and a second field is used as a field of the log file. Thus, the server queries the second field in the Mysql database to determine whether there is a log file for the corresponding test device in the Mysql database.
Table 1 shows a table in the Mysql database of one embodiment of the invention. As shown in table 1, the MACs 1-3 correspond to the testing devices 1-3, respectively, and when the server receives a message that the testing device 1 finishes testing, the server issues a log obtaining request of the testing device 1 to the first field corresponding to the MAC1 in table 1, polls whether data exists in the second field of the MAC1, and when data exists in the second field, obtains the data in the second field, that is, obtains the log file of the testing device 1.
TABLE 1
Test equipment identification First field Second field
MAC1
MAC2
MAC3
Further, on the basis of the above embodiment, the monitoring unit 320 is adapted to set a preset time or a preset frequency; and inquiring whether data exist in a second field corresponding to the test equipment in a specified data table of the Mysql database at preset time intervals or according to preset frequency.
In this embodiment, polling is performed by setting a preset time or a preset frequency. For example, the frequency is set every 10 minutes, or the preset time is set to 0 point, 1 point, 2 points, or the like.
Further, the first field and the second field corresponding to each test device in the specified data table specifically correspond to the MAC address of the test device.
In order to make the first field and the second field corresponding to each testing device uniquely identified, the MAC address of the corresponding testing device may be used for identification. For example, what corresponds to test device 1 as in table 1 is MAC 1; corresponding to test device 2 is MAC 2; corresponding to test device 3 is MAC 3.
In one embodiment of the present invention, the server shown in fig. 3 further includes:
and the judging unit is suitable for judging whether the use time length of each application in the acquired log file is consistent with the preset time length in the corresponding test case or not, and if so, the test is passed.
Therefore, in this embodiment, whether the usage duration of each application in the acquired log file is consistent with the preset duration in the corresponding test case is determined by the server, so as to test whether the application duration statistical function of the router is accurate.
Fig. 4 is a schematic structural diagram of an apparatus for acquiring a log file according to an embodiment of the present invention. As shown in fig. 4, the log file acquiring apparatus 400 includes:
the obtaining unit 410 is adapted to obtain a log file corresponding to each testing device in the router.
In this embodiment, the log file acquiring device and the router adopt the same network segment for accessing the internet, and are connected with the router for acquiring the log file in the router. The log file acquiring means here includes a PC.
The monitoring unit 420 is adapted to monitor whether there is a log obtaining request corresponding to each test device in the intermediate database.
In order to determine the time for issuing the log file to the intermediary database, it is necessary to monitor whether there is a log acquisition request corresponding to each test device in the intermediary data.
The issuing unit 430 is adapted to issue a log file corresponding to a test device in the intermediate database according to a log obtaining request when the log obtaining request of the test device in the intermediate database is monitored.
When there is a log obtaining request of the test device in the intermediate database, it indicates that the test device has been tested, and may release the log file to the intermediate database, so that the test server may obtain the log file of the test device that has been tested from the intermediate database.
Therefore, according to the technical scheme, through the combination of the device and the intermediate database, even if the test server and the router are in a cross-network segment, the test server can acquire the log file in the router, and further the test of the application statistical function of the router is realized.
In this technical solution, the broker database may adopt a Redis database and a Mysql database, and different broker databases have different characteristics, so that the execution mode of this technical solution is also different, and the following detailed description is provided.
In one embodiment of the invention, the intermediary database is a Redis database.
The monitoring unit 420 is adapted to subscribe to a first channel corresponding to each testing device in the Redis database; when data exist in a first channel corresponding to one testing device, determining that a log acquisition request corresponding to the testing device exists in a Redis database.
The publishing unit 430 is adapted to publish the log file corresponding to the test device to the second channel corresponding to the test device in the Redis database.
The first channels correspond to the second channels one to one.
In this embodiment, the broker database is a Redis database, and the test server may subscribe to a channel of the Redis database by using a subscription and publishing function of the Redis database, so as to determine whether there is a log file in the Redis database.
And the first channel in the Redis database is used as a channel for the log acquisition request, and the second channel is used as a channel for the log file. Thus, the test server subscribes to the second channel in the Redis database to determine whether the log file of the corresponding test device exists in the Redis database.
In practical application, one test device corresponds to one first channel in a Redis database, a plurality of test devices need a plurality of first channels in the Redis database, and each test device corresponds to one first channel; one test device corresponds to one second channel in the Redis database, a plurality of test devices need a plurality of second channels in the Redis database, and each test device corresponds to one second channel. Furthermore, the first channel and the second channel of a test device are in one-to-one correspondence. For example, the test device 1 and the test device 2, the first channel 1 and the second channel 1 in the Redis database correspond to the test device 1, and the first channel 2 and the second channel 2 correspond to the test device 2. The log file acquisition device subscribes to a first channel of each test device. When a first channel 1 of the test equipment 1 has a log obtaining request, a log file of the test equipment 1 is issued to a second channel of the test equipment 1; when the first channel 1 of the test device 2 has a log obtaining request, the log file of the test device 2 is issued to the second channel of the test device 2.
Further, the first frequency channel and the second frequency channel are identified according to the MAC address of the test device.
In order to make the first frequency channel and the second frequency channel uniquely identifiable, the identification may be performed using the MAC address of the corresponding test device. The MAC Address (Media Access Control Address) is translated into a Media Access Control Address, also called a local area network Address (LAN Address), an Ethernet Address (Ethernet Address) or a physical Address (physical Address), which is an Address for confirming the location of the devices on the network, that is, the MAC Address corresponding to each test device is unique.
For example, the first channel 1 corresponding to test device 1 in the Redis database is MAC1, the second channel 1 is MAC1_ R; the second channel 2 is the MAC2_ R corresponding to the first channel MAC2 of the test device 2.
In one embodiment of the invention, the intermediary database is a Mysql database.
The monitoring unit 420 is adapted to perform polling monitoring on whether data exist in the first field corresponding to each test device in the specified data table of the Mysql database; when data in a first field corresponding to one testing device in the specified data table is monitored, determining that a log acquisition request corresponding to the testing device exists in the Mysql database.
The publishing unit 430 is adapted to publish the log file corresponding to the test device to a second field corresponding to the test device in a specified data table of the Mysql database.
In this embodiment, the broker database is a Mysql database, which has no subscription and publishing functions of the Redis database, and is therefore implemented in the form of a created table. And creating a table in the Mysql database, wherein each row of the table represents a test device, a corresponding first field is used as a field of the log acquisition request, and a second field is used as a field of the log file. Therefore, the log file acquiring device can determine whether the Mysql database has a log acquiring request of the corresponding test equipment by inquiring the first field in the Mysql database, and the log file is issued to the second field of the corresponding test equipment so as to be inquired by the server.
As shown in table 1, the MACs 1-3 correspond to the testing devices 1-3, respectively, the log file obtaining device polls the first field of the testing device 1, that is, the MAC1, when there is a log obtaining request in the first field of the MAC1, the log file of the testing device 1 is issued to the second field of the slave MAC1, the server polls whether there is data in the second field of the MAC1, and when there is data in the second field, the data in the second field is obtained, that is, the log file of the testing device 1 is obtained.
Further, on the basis of the above embodiment, the monitoring unit 420 is adapted to set a preset time or a preset frequency; and inquiring whether data exist in a first field corresponding to the test equipment in a specified data table of the Mysql database at preset time intervals or according to a preset frequency.
In this embodiment, polling is performed by setting a preset time or a preset frequency. For example, the frequency is set every 10 minutes, or the preset time is set to 0 point, 1 point, 2 points, or the like.
Further, the first field and the second field corresponding to each test device in the specified data table specifically correspond to the MAC address of the test device.
In order to make the first field and the second field corresponding to each testing device uniquely identified, the MAC address of the corresponding testing device may be used for identification. For example, what corresponds to test device 1 as in table 1 is MAC 1; corresponding to test device 2 is MAC 2; corresponding to test device 3 is MAC 3.
In one embodiment of the present invention, the apparatus shown in fig. 4 further comprises:
the analysis unit is suitable for analyzing the acquired log files corresponding to the test equipment; and obtaining the service life of each application corresponding to each test device.
The issuing unit 430 is adapted to issue the obtained usage duration of each application corresponding to the testing device to the intermediary database as a log file corresponding to the testing device.
When monitoring a log acquisition request of a test device, the device analyzes a log file of the test device to obtain the use duration of each application corresponding to the test device, and issues the use duration of each application corresponding to the test device to the intermediate database, wherein the use duration of each application in the log file is counted by the application duration counting function of the router, so that when the server acquires the log file, whether the use duration of each application in the acquired log file is consistent with the preset duration in a corresponding test case can be judged, and if the use duration of each application in the acquired log file is consistent with the preset duration in the corresponding test case, the test is passed.
Fig. 5 is a schematic structural diagram of a log file acquisition system according to an embodiment of the present invention. As shown in fig. 5, the log file acquiring system 500 includes: an acquisition server 300 of a log file shown in fig. 3, an acquisition apparatus 400 of a log file shown in fig. 4, and an intermediary database 510.
It should be noted that, the embodiments of the system shown in fig. 5 correspond to the methods shown in fig. 1 and fig. 2 and the embodiments thereof, and the detailed description is already provided above, and is not repeated here.
In a specific example, fig. 6 is a schematic structural diagram illustrating a log file obtaining system according to another embodiment of the present invention, where the system includes a PC, a Redis database, and a web server; the system also comprises a router and 3 test devices (not limited to 3), wherein the test devices are the mobile phone 1, the tablet 2 and the device 3 respectively, the test devices surf the internet through the router, the web server is connected with the mobile phone 1, the tablet 2 and the device 3, and the PC is connected with the router.
The Redis database is provided with a first channel MAC1 and a second channel MAC1_ R corresponding to the mobile phone 1; corresponding to the tablet 2, the first channel MAC2 and the second channel MAC2_ R are provided; the corresponding device 3 has a first channel MAC3 and a second channel MAC3_ R. web server subscribe (dashed arrow in fig. 6 represents subscribe) MAC1_ R, MAC2_ R, MAC3_ R; PCs subscribe (dashed arrows in fig. 6 indicate subscriptions) to MAC1, MAC2, MAC 3. After the mobile phone 1 automatically executes the test case, the web server is notified, receives the message that the test of the mobile phone 1 is finished, and issues the log acquisition request of the mobile phone 1 to the MAC 1; the PC acquires the log file of the mobile phone 1 from the router, and when the PC monitors that a log acquisition request exists in the MAC1, the log file corresponding to the mobile phone 1 is issued to the MAC1_ R; and the web server monitors that the MAC1_ R has data, and then acquires the data, namely acquires the log file of the mobile phone 1.
In summary, according to the technical solution of the present invention, when receiving a message indicating that a test of a test device is completed, a test server issues a log obtaining request of the test device to an intermediary database; monitoring whether a log file corresponding to the test equipment exists in an intermediary database; and when the log file corresponding to the test equipment is monitored in the intermediate database, acquiring the log file. The log file acquisition device acquires log files corresponding to all test equipment in the router; monitoring whether a journal acquisition request corresponding to each test device exists in an intermediary database; when a log acquisition request of a test device in the intermediate database is monitored, a log file corresponding to the test device is issued to the intermediate database according to the log acquisition request. Therefore, according to the technical scheme, through the combination of the device and the intermediate database, even if the test server and the router are in a cross-network segment, the test server can acquire the log file in the router, and further the test of the application statistical function of the router is realized.
It should be noted that:
the algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose devices may be used with the teachings herein. The required structure for constructing such a device will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components of the log file acquisition server, apparatus, system, electronic device, and computer-readable storage medium according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
For example, fig. 7 shows a schematic structural diagram of an electronic device according to an embodiment of the invention. The electronic device 700 conventionally comprises a processor 710 and a memory 720 arranged to store computer-executable instructions (program code). The memory 720 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Memory 720 has storage space 730 for storing program code 740 for performing the method steps shown in fig. 1 or fig. 2 and in any of the embodiments. For example, the storage space 730 for the program code may include respective program codes 740 for respectively implementing various steps in the above method. The program code can be read from or written to one or more computer program products. These computer program products comprise a program code carrier such as a hard disk, a Compact Disc (CD), a memory card or a floppy disk. Such a computer program product is generally a computer-readable storage medium 800, such as described in fig. 8. The computer-readable storage medium 800 may have memory segments, memory spaces, etc. arranged similarly to the memory 720 in the electronic device of fig. 7. The program code may be compressed, for example, in a suitable form. In general, the memory unit stores program code 810 for performing the steps of the method according to the invention, i.e. program code readable by a processor such as 710, which when run by an electronic device causes the electronic device to perform the steps of the method described above.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The invention discloses A1 and a method for acquiring a log file, wherein the method comprises the following steps:
when receiving a message of test equipment test completion, issuing a log acquisition request of the test equipment to an intermediary database;
monitoring whether a log file corresponding to the test equipment exists in the intermediate database;
and when the log file corresponding to the test equipment is monitored in the intermediate database, acquiring the log file.
A2, the method of A1, wherein the intermediary database is a Redis database;
the issuing of the log acquisition request of the test device to the intermediary database includes: issuing a log acquisition request of the test equipment to a first channel corresponding to the test equipment in a Redis database;
the monitoring whether the intermediate database has the log file corresponding to the test device includes: subscribing a second channel corresponding to the test equipment in the Redis database; when data exist in the second channel, determining that a log file corresponding to the testing equipment exists in the Redis database;
the first channels correspond to the second channels one to one.
A3, the method of A2, wherein the first frequency channel and the second frequency channel are identified according to a MAC address of a test device.
A4, the method of A1, wherein the intermediary database is a Mysql database;
the issuing of the log acquisition request of the test device to the intermediary database includes: issuing a log acquisition request of the test equipment to a first field corresponding to the test equipment in a specified data table of a Mysql database;
the monitoring whether the intermediate database has the log file corresponding to the test device includes: polling and monitoring whether data exist in a second field corresponding to the test equipment in a specified data table of the Mysql database; and when the data in the second field is monitored, determining that the log file corresponding to the test equipment exists in the Mysql database.
A5, the method as in A4, wherein the polling to listen to the Mysql database includes:
setting a preset time or a preset frequency;
and inquiring whether data exist in a second field corresponding to the test equipment in a specified data table of the Mysql database at preset time intervals or according to preset frequency.
A6, the method as in a4, wherein the first field and the second field corresponding to each test device in the specified data table specifically correspond to the MAC address of the test device.
A7, the method of a1, wherein the method further comprises:
and judging whether the use duration of each application in the acquired log file is consistent with the preset duration in the corresponding test case, and if so, passing the test.
The invention also discloses B8 and a method for acquiring the log file, wherein the method comprises the following steps:
acquiring log files corresponding to all test devices in a router;
monitoring whether a journal acquisition request corresponding to each test device exists in an intermediary database;
when a log acquisition request of a test device in the intermediate database is monitored, a log file corresponding to the test device is issued to the intermediate database according to the log acquisition request.
B9, the method of B8, wherein the broker database is a Redis database;
whether the monitoring intermediary database has log acquisition requests corresponding to the test devices or not comprises the following steps: subscribing a first channel corresponding to each testing device in a Redis database; when data exist in a first channel corresponding to one testing device, determining that a log acquisition request corresponding to the testing device exists in the Redis database;
the publishing the log file corresponding to the test device to the intermediary database comprises: the log file corresponding to the test equipment is issued to a second channel corresponding to the test equipment in the Redis database;
the first channels correspond to the second channels one to one.
B10, the method as in B9, wherein the first frequency channel and the second frequency channel are identified according to a MAC address of a test device.
B11, the method of B8, wherein the broker database is a Mysql database;
whether the monitoring intermediary database has log acquisition requests corresponding to the test devices or not comprises the following steps: polling and monitoring whether data exist in a first field corresponding to each test device in an appointed data table of the Mysql database; when monitoring that data exist in a first field corresponding to one testing device in an appointed data table, determining that a log acquisition request corresponding to the testing device exists in the Mysql database;
the publishing the log file corresponding to the test device to the intermediary database comprises: and issuing the log file corresponding to the test equipment to a second field corresponding to the test equipment in a specified data table of the Mysql database.
B12, the method according to B11, wherein the polling and monitoring Mysql database includes whether there is data in a first field corresponding to each test device in a specified data table includes:
setting a preset time or a preset frequency;
and inquiring whether data exist in a first field corresponding to the test equipment in a specified data table of the Mysql database at preset time intervals or according to a preset frequency.
B13, the method according to B11, wherein the first field and the second field corresponding to each test device in the specified data table specifically correspond to the MAC address of the test device.
B14, the method according to B8, wherein the method further comprises:
analyzing the obtained log files corresponding to the test equipment; obtaining the service time of each application corresponding to each test device;
the publishing the log file corresponding to the test device to the intermediary database comprises: and issuing the obtained service duration of each application corresponding to the test equipment to the intermediary database as a log file corresponding to the test equipment.
The invention also discloses C15, a server for acquiring the log file, wherein the server comprises:
the release unit is suitable for releasing the log acquisition request of the test equipment to the intermediary database when receiving a message of test equipment test completion;
the monitoring unit is suitable for monitoring whether the log file corresponding to the test equipment exists in the intermediate database;
and the acquisition unit is suitable for acquiring the log file when the log file corresponding to the test equipment is monitored in the intermediate database.
C16, the server as in C15, wherein the intermediary database is a Redis database;
the release unit is suitable for releasing the log acquisition request of the test equipment to a first channel corresponding to the test equipment in a Redis database;
the monitoring unit is suitable for subscribing a second channel corresponding to the testing equipment in a Redis database; when data exist in the second channel, determining that a log file corresponding to the testing equipment exists in the Redis database;
the first channels correspond to the second channels one to one.
C17, the server as C16, wherein the first channel and the second channel are identified according to the MAC address of the testing equipment.
C18, the server according to C15, wherein the intermediary database is Mysql database;
the release unit is suitable for releasing the log acquisition request of the test equipment to a first field corresponding to the test equipment in a specified data table of the Mysql database;
the monitoring unit is suitable for polling and monitoring whether data exist in a second field corresponding to the test equipment in an appointed data table of the Mysql database; and when the data in the second field is monitored, determining that the log file corresponding to the test equipment exists in the Mysql database.
C19, the server according to C18, wherein,
the monitoring unit is suitable for setting preset time or preset frequency; and inquiring whether data exist in a second field corresponding to the test equipment in a specified data table of the Mysql database at preset time intervals or according to preset frequency.
C20, the server according to C18, wherein the first field and the second field corresponding to each testing device in the specified data table specifically correspond to the MAC address of the testing device.
C21, the server according to C15, wherein the server further comprises:
and the judging unit is suitable for judging whether the use time length of each application in the acquired log file is consistent with the preset time length in the corresponding test case or not, and if so, the test is passed.
The invention also discloses D22 and an acquisition device of the log file, wherein the device comprises:
the acquisition unit is suitable for acquiring log files corresponding to all the test devices in the router;
the monitoring unit is suitable for monitoring whether the intermediate database has log acquisition requests corresponding to the test equipment;
the issuing unit is suitable for issuing a log file corresponding to a test device to the intermediary database according to a log obtaining request when the log obtaining request of the test device in the intermediary database is monitored.
D23, the apparatus of D22, wherein the intermediary database is a Redis database;
the monitoring unit is suitable for subscribing a first channel corresponding to each testing device in a Redis database; when data exist in a first channel corresponding to one testing device, determining that a log acquisition request corresponding to the testing device exists in the Redis database;
the release unit is suitable for releasing the log file corresponding to the test equipment to a second channel corresponding to the test equipment in the Redis database;
the first channels correspond to the second channels one to one.
D24, the apparatus of D23, wherein the first and second frequency channels are identified according to a MAC address of a test device.
D25, the apparatus of D22, wherein the intermediary database is a Mysql database;
the monitoring unit is suitable for polling and monitoring whether data exist in the first fields corresponding to the test equipment in the specified data table of the Mysql database; when monitoring that data exist in a first field corresponding to one testing device in an appointed data table, determining that a log acquisition request corresponding to the testing device exists in the Mysql database;
the publishing unit is suitable for publishing the log file corresponding to the test device to a second field corresponding to the test device in a specified data table of the Mysql database.
D26, the device of D25, wherein,
the monitoring unit is suitable for setting preset time or preset frequency; and inquiring whether data exist in a first field corresponding to the test equipment in a specified data table of the Mysql database at preset time intervals or according to a preset frequency.
D27, the apparatus according to D25, wherein the first field and the second field corresponding to each test device in the designation data table specifically correspond to a MAC address of the test device.
D28. the apparatus of D22, wherein the apparatus further comprises:
the analysis unit is suitable for analyzing the acquired log files corresponding to the test equipment; obtaining the service time of each application corresponding to each test device;
the issuing unit is adapted to issue the obtained usage duration of each application corresponding to the test device to the intermediary database as a log file corresponding to the test device.
The invention also discloses E29, a log file acquisition system, wherein the system comprises the server according to any one of C15-C21, the device according to any one of D22-D28 and a medium database.
The invention also discloses F30 and electronic equipment, wherein the electronic equipment comprises:
a processor; and the number of the first and second groups,
a memory arranged to store computer executable instructions that when executed cause the processor to perform a method according to any one of A1-A7 or B8-B14.
The invention also discloses G31, a computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement the method of any one of A1-A7 or B8-B14.

Claims (10)

1. A log file acquisition method comprises the following steps:
when receiving a message of test equipment test completion, issuing a log acquisition request of the test equipment to an intermediary database;
monitoring whether a log file corresponding to the test equipment exists in the intermediate database;
and when the log file corresponding to the test equipment is monitored in the intermediate database, acquiring the log file.
2. The method of claim 1, wherein the intermediary database is a Redis database;
the issuing of the log acquisition request of the test device to the intermediary database includes: issuing a log acquisition request of the test equipment to a first channel corresponding to the test equipment in a Redis database;
the monitoring whether the intermediate database has the log file corresponding to the test device includes: subscribing a second channel corresponding to the test equipment in the Redis database; when data exist in the second channel, determining that a log file corresponding to the testing equipment exists in the Redis database;
the first channels correspond to the second channels one to one.
3. The method of claim 2, wherein the first frequency channel and the second frequency channel are identified according to a MAC address of a test device.
4. The method of claim 1, wherein the intermediary database is a Mysql database;
the issuing of the log acquisition request of the test device to the intermediary database includes: issuing a log acquisition request of the test equipment to a first field corresponding to the test equipment in a specified data table of a Mysql database;
the monitoring whether the intermediate database has the log file corresponding to the test device includes: polling and monitoring whether data exist in a second field corresponding to the test equipment in a specified data table of the Mysql database; and when the data in the second field is monitored, determining that the log file corresponding to the test equipment exists in the Mysql database.
5. A log file acquisition method comprises the following steps:
acquiring log files corresponding to all test devices in a router;
monitoring whether a journal acquisition request corresponding to each test device exists in an intermediary database;
when a log acquisition request of a test device in the intermediate database is monitored, a log file corresponding to the test device is issued to the intermediate database according to the log acquisition request.
6. A log file acquisition server, wherein the server comprises:
the release unit is suitable for releasing the log acquisition request of the test equipment to the intermediary database when receiving a message of test equipment test completion;
the monitoring unit is suitable for monitoring whether the log file corresponding to the test equipment exists in the intermediate database;
and the acquisition unit is suitable for acquiring the log file when the log file corresponding to the test equipment is monitored in the intermediate database.
7. An apparatus for acquiring a log file, wherein the apparatus comprises:
the acquisition unit is suitable for acquiring log files corresponding to all the test devices in the router;
the monitoring unit is suitable for monitoring whether the intermediate database has log acquisition requests corresponding to the test equipment;
the issuing unit is suitable for issuing a log file corresponding to a test device to the intermediary database according to a log obtaining request when the log obtaining request of the test device in the intermediary database is monitored.
8. A log file acquisition system, wherein the system comprises the server of claim 6, the apparatus of claim 7 and an intermediary database.
9. An electronic device, wherein the electronic device comprises:
a processor; and the number of the first and second groups,
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the method of any of claims 1 to 4 or claim 5.
10. A computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement the method of any of claims 1-4 or claim 5.
CN201811518400.6A 2018-12-12 2018-12-12 Log file acquisition method, server, device and system Pending CN111309694A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811518400.6A CN111309694A (en) 2018-12-12 2018-12-12 Log file acquisition method, server, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811518400.6A CN111309694A (en) 2018-12-12 2018-12-12 Log file acquisition method, server, device and system

Publications (1)

Publication Number Publication Date
CN111309694A true CN111309694A (en) 2020-06-19

Family

ID=71148835

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811518400.6A Pending CN111309694A (en) 2018-12-12 2018-12-12 Log file acquisition method, server, device and system

Country Status (1)

Country Link
CN (1) CN111309694A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113015203A (en) * 2021-03-22 2021-06-22 Oppo广东移动通信有限公司 Information acquisition method, device, terminal, system and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101106508A (en) * 2006-07-14 2008-01-16 华为技术有限公司 A method for obtainment user specification in isomerous system
CN101783802A (en) * 2010-02-03 2010-07-21 中国电信股份有限公司 Distributed streaming media release system and method thereof
CN101848245A (en) * 2010-02-05 2010-09-29 南京德讯信息***有限公司 Database access agent method and system based on SSL/XML
CN102055814A (en) * 2010-11-25 2011-05-11 深圳市科陆电子科技股份有限公司 Method for realizing cross-network segment real-time collection
CN103440336A (en) * 2013-09-06 2013-12-11 济钢集团有限公司 Safe physical-isolation automatic transmission method of network database tables
US20140115576A1 (en) * 2012-10-18 2014-04-24 Vmware, Inc. Extensible Network Configuration Management
CN104486107A (en) * 2014-12-05 2015-04-01 曙光信息产业(北京)有限公司 Log collection device and method
CN106789755A (en) * 2016-11-30 2017-05-31 中国电子科技集团公司第五十四研究所 Inter-network data interchange platform

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101106508A (en) * 2006-07-14 2008-01-16 华为技术有限公司 A method for obtainment user specification in isomerous system
CN101783802A (en) * 2010-02-03 2010-07-21 中国电信股份有限公司 Distributed streaming media release system and method thereof
CN101848245A (en) * 2010-02-05 2010-09-29 南京德讯信息***有限公司 Database access agent method and system based on SSL/XML
CN102055814A (en) * 2010-11-25 2011-05-11 深圳市科陆电子科技股份有限公司 Method for realizing cross-network segment real-time collection
US20140115576A1 (en) * 2012-10-18 2014-04-24 Vmware, Inc. Extensible Network Configuration Management
CN103440336A (en) * 2013-09-06 2013-12-11 济钢集团有限公司 Safe physical-isolation automatic transmission method of network database tables
CN104486107A (en) * 2014-12-05 2015-04-01 曙光信息产业(北京)有限公司 Log collection device and method
CN106789755A (en) * 2016-11-30 2017-05-31 中国电子科技集团公司第五十四研究所 Inter-network data interchange platform

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SIYU GU 等: "Cross domain random walk for query intent pattern mining from search engine log", 《2011 IEEE 11TH INTERNATIONAL CONFERENCE ON DATA MINING》, 23 January 2012 (2012-01-23), pages 1 - 2 *
许英 等: "跨网信息提醒***的设计与实现", 《中国新通信》, vol. 20, no. 15, 5 August 2018 (2018-08-05), pages 53 - 54 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113015203A (en) * 2021-03-22 2021-06-22 Oppo广东移动通信有限公司 Information acquisition method, device, terminal, system and storage medium

Similar Documents

Publication Publication Date Title
CN111371638B (en) Intelligent equipment testing method and device, server and storage medium
CN108255620B (en) Service logic processing method, device, service server and system
CN109995612B (en) Service inspection method and device and electronic equipment
CN110932933B (en) Network condition monitoring method, computing device and computer storage medium
CN112328458A (en) Data processing method and device based on flink data engine
CN104683181A (en) Performance monitoring method, equipment and system
CN104468222A (en) Method, device and system for reporting log information
CN109598526B (en) Method and device for analyzing media contribution
CN111309694A (en) Log file acquisition method, server, device and system
CN110865828A (en) Data upgrading method, device, equipment and computer readable storage medium
CN111367766A (en) Method, device and equipment for determining connection relation between monitoring host and equipment
CN107220160B (en) Method and device for determining electric quantity consumption of application program
CN110502486B (en) Log processing method and device, electronic equipment and computer readable storage medium
CN117290557A (en) Data loading method, related device, equipment and readable storage medium
CN110032486B (en) Server testing method and device, computer equipment and storage medium
CN107679198B (en) Information query method and device
CN108829590B (en) Software testing method, device and system
CN110765089A (en) Distributed equipment and log recording method, device and storage medium thereof
US10108524B2 (en) Recording CPU time for sample of computing thread based on CPU use state of activity associated with the sample
CN114416812A (en) Data statistical method and device, electronic equipment and storage medium
US9201771B2 (en) Method for evaluating a production rule for a memory management analysis
CN113031995A (en) Rule updating method and device, storage medium and electronic equipment
CN109388500B (en) Processing method and system based on wireless Measurement Report (MR)
CN113014456A (en) Monitoring data transmission system, method, device, equipment and storage medium
CN110750409A (en) Method, device and system for realizing test

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