Log file acquisition method and related device
By using backup mapping relationship and real-time mapping relationship in the log file acquisition method, the problem of unfixed IP addresses of mobile devices is solved, and the accurate acquisition and analysis of device log files is achieved.
Patent Information
- Application Number
- CN202311392486.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-25
- Publication Date
- 2025-04-25
AI Technical Summary
Because the IP address of a mobile device is not fixed, it is impossible to obtain the device log file through the IP address, and thus it is impossible to analyze its overall usage.
By obtaining the initial IP address based on the backup mapping relationship, obtaining the actual device identification accessed through the initial IP address, and verifying whether the target device identification is consistent with the actual device identification. If it is consistent, the device log file will be directly obtained; if it is inconsistent, the target device identification corresponding to the target IP address from the real-time mapping relationship is queried to obtain the log file.
Even if the IP address of a mobile device changes, its actual IP address can still be determined, ensuring the accuracy and completeness of the device log file, and then analyzing its usage.
Smart Images

Figure CN119892784A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a log file acquisition method and related devices. Background Art
[0002] The current log acquisition method is generally that the log collection box obtains the device log file of the ultrasound device currently connected to the workstation through the pre-configured workstation IP address, and obtains the workstation log file to combine and analyze the overall usage of the ultrasound device.
[0003] However, for mobile devices that need to work in a mobile manner due to work scenarios, for example, ultrasound equipment in the medical field, they generally move between various departments in the hospital. Every time the ultrasound equipment moves to a department, its device IP will be modified to the IP of the workstation in the department, so that the ultrasound equipment can connect to the workstation to complete the ultrasound diagnosis.
[0004] Therefore, since the IP of the portable device is not fixed, it is impossible to obtain the device log file of the portable device according to the IP address, nor is it possible to find the corresponding workstation or the device corresponding to the workstation according to the device, and thus it is impossible to complete the overall usage analysis of the portable device. Summary of the invention
[0005] In view of this, in order to at least solve the problem of obtaining device log files of a portable device, the present application provides a log file obtaining method and related apparatus.
[0006] A first aspect of the present application provides a log file acquisition method, the method comprising:
[0007] Acquire an initial IP address corresponding to a target device identifier of a target mobile device based on a backup mapping relationship;
[0008] Obtaining an actual device identifier of the portable device accessed through the initial IP address;
[0009] When the target device identifier and the actual device identifier are the same, obtaining a device log file of the target portable device;
[0010] When the target device identifier and the actual device identifier are different, the target IP address corresponding to the target device identifier is queried from the real-time mapping relationship, and the device log file of the target mobile device is obtained through the target IP address; wherein, the data immediacy of the real-time mapping relationship is higher than that of the backup mapping relationship.
[0011] A second aspect of the present application provides a log file acquisition method, which is applied to a transfer device, and the transfer device is used to establish communication between a server and a mobile device; the method comprises:
[0012] Acquire the IP address corresponding to the target device identifier of the target mobile device based on the pre-stored local mapping relationship; the local mapping relationship is stored in the transfer device;
[0013] Obtaining an actual device identifier of the portable device accessed through the IP address;
[0014] When the target device identifier and the actual device identifier are the same, obtaining a device log file of the target portable device;
[0015] When the target device identifier and the actual device identifier are different, an IP query request of the target mobile device is sent to the server; the server stores a real-time mapping relationship between the mobile device and the IP address;
[0016] When the target IP address fed back by the server based on the IP query request is received, the device log file of the target mobile device is obtained through the target IP address.
[0017] A third aspect of the present application provides a log file acquisition method, which is applied to a server, and the server communicates with a mobile device through a transfer device; the method comprises:
[0018] When receiving an IP query request for a target mobile device sent by the transfer device, the target device identifier, initial IP address and actual device identifier contained in the IP query request are obtained; wherein the target device identifier represents the device identifier of the target mobile device, the initial IP address represents the IP address corresponding to the target device identifier queried by the transfer device based on its pre-stored local mapping relationship, and the actual device identifier represents the device identifier of the mobile device actually accessed by the transfer device based on the initial IP address;
[0019] Based on the target device identifier, query the real-time IP address corresponding to the target device identifier from the pre-stored real-time mapping relationship;
[0020] When the real-time IP address is different from the initial IP address, the real-time IP address is fed back to the transfer device, and the real-time IP address is used for the transfer device to access the target mobile device to obtain the device log file of the target mobile device.
[0021] The fourth aspect of the present application provides a log file acquisition system, comprising a server, a transfer device connected to the server for communication, and a portable device connected to the transfer device for communication; wherein the transfer device is used to obtain the device log file of the target portable device for which the device log file needs to be obtained through the log file acquisition method provided in the second aspect above; and the server is used to provide the transfer device with the data required to obtain the device log file according to the log file acquisition method provided in the third aspect above.
[0022] A fifth aspect of the present application provides a log file acquisition device, the device comprising:
[0023] The first address acquisition module is configured to: acquire an initial IP address corresponding to a target device identifier of a target mobile device based on a backup mapping relationship;
[0024] A first identification acquisition module is configured to: acquire an actual device identification of the portable device accessed through the initial IP address;
[0025] The first log acquisition module is configured to: when the target device identifier and the actual device identifier are the same, obtain the device log file of the target mobile device; when the target device identifier and the actual device identifier are different, query the target IP address corresponding to the target device identifier from the real-time mapping relationship, and obtain the device log file of the target mobile device through the target IP address; wherein the data immediacy of the real-time mapping relationship is higher than that of the backup mapping relationship.
[0026] A sixth aspect of the present application provides a log file acquisition device, the device is applied to a transfer device, the transfer device is used to establish communication between a server and a mobile device; the device includes:
[0027] The second address acquisition module is configured to: acquire the IP address corresponding to the target device identifier of the target mobile device based on a pre-stored local mapping relationship; the local mapping relationship is stored in the transfer device;
[0028] The second identification acquisition module is configured to: acquire the actual device identification of the mobile device accessed through the IP address;
[0029] The second log acquisition module is configured to: when the target device identifier and the actual device identifier are the same, obtain the device log file of the target portable device; when the target device identifier and the actual device identifier are different, send an IP query request of the target portable device to the server; the server stores a real-time mapping relationship between portable devices and IP addresses; and when receiving the target IP address fed back by the server based on the IP query request, obtain the device log file of the target portable device through the target IP address.
[0030] A seventh aspect of the present application provides a log file acquisition device, the device is applied to a server, the server communicates with a mobile device through a transfer device; the device includes:
[0031] The receiving module is configured to: upon receiving an IP query request of a target mobile device sent by the transfer device, obtain the target device identifier, initial IP address and actual device identifier contained in the IP query request; wherein the target device identifier represents the device identifier of the target mobile device, the initial IP address represents the IP address corresponding to the target device identifier queried by the transfer device based on its pre-stored local mapping relationship, and the actual device identifier represents the device identifier of the mobile device actually accessed by the transfer device based on the initial IP address;
[0032] A query module is configured to: based on the target device identifier, query the real-time IP address corresponding to the target device identifier from a pre-stored real-time mapping relationship;
[0033] The sending module is configured to: when the real-time IP address is different from the initial IP address, feed back the real-time IP address to the transfer device, and the real-time IP address is used for the transfer device to access the target mobile device to obtain the device log file of the target mobile device.
[0034] An eighth aspect of the present application provides an electronic device, including:
[0035] processor;
[0036] a memory for storing a computer program executable by the processor;
[0037] When the processor executes the program, the steps of the log file acquisition method provided in the first aspect, and / or the second aspect, and / or the third aspect are implemented.
[0038] The ninth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the log file acquisition method provided in the first aspect, and / or the second aspect, and / or the third aspect.
[0039] Compared with the prior art, the present invention has at least the following beneficial effects:
[0040] This application adds pre-processing logic before obtaining the log file - first obtain the initial IP address corresponding to the target device identifier of the target portable device based on the backup mapping relationship, then obtain the actual device identifier of the portable device accessed through the initial IP address, and then verify the target device identifier and the actual device identifier. If the target device identifier and the actual device identifier are the same, it means that the device accessed through the initial IP address is indeed the target portable device, and the device log file of the target portable device can be obtained by accessing the initial IP address. If the target device identifier and the actual device identifier are different, it means that the device accessed through the initial IP address is not the target portable device, and the IP of the target portable device has changed. At this time, the target IP address corresponding to the target device identifier will be queried from the real-time mapping relationship with higher data immediacy, that is, the IP address that can access the target portable device is found, and then the device log file of the target portable device can be obtained by accessing the target IP address. Therefore, even if the IP address of the target portable device changes, the actual IP address of the target portable device can still be determined through the present application, thereby ensuring the acquisition of the device log file of the target portable device, while also improving the accuracy of the acquisition of the device log file, which is conducive to the subsequent accurate analysis of the device usage of the target portable device based on the correct device log file.
[0041] Among them, the initial IP address corresponding to the target device identifier is first obtained from the backup mapping relationship, and when the actual device identifier of the mobile device actually connected to the IP address obtained by accessing the initial IP address is different from the target device identifier, the target IP address corresponding to the target device identifier is queried from the real-time mapping relationship. This is beneficial to avoid the computational burden caused by directly accessing the real-time mapping relationship and the cache storing the real-time mapping relationship.
[0042] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 is a flow chart of a method for obtaining a log file according to an exemplary embodiment of the present application;
[0044] Figure 2 is a flow chart of another log file acquisition method according to an exemplary embodiment of the present application;
[0045] Figure 3 is a flow chart of another log file acquisition method according to an exemplary embodiment of the present application;
[0046] Figure 4 is a flow chart of another log file acquisition method according to an exemplary embodiment of the present application;
[0047] Figure 5 is a flow chart of another log file acquisition method according to an exemplary embodiment of the present application;
[0048] Figure 6 is a flow chart of a log file acquisition method applied to a transfer device according to an exemplary embodiment of the present application;
[0049] Figure 7 is a flow chart of a log file acquisition method applied to a server according to an exemplary embodiment of the present application;
[0050] Figure 8 It is a hardware structure diagram of an electronic device where a log file acquisition device is located according to an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0051] Here, the exemplary embodiments will be described in detail, and the examples thereof are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. Moreover, the implementation methods described in the following exemplary embodiments do not limit the present application, and the structural, methodological, or functional changes made by ordinary technicians in the field according to these implementation methods are all included in the protection scope of the present application.
[0052] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0053] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0054] The following is a more specific description of the log file acquisition method of the embodiment of the present application, but it should not be limited to this.
[0055] The embodiment of the present application provides a log file acquisition method, which is applied to the log acquisition scenario of a portable device with a non-fixed IP address and its workstation. The method can be applied to a server that can communicate directly with the portable device, or to a transfer device used to realize communication between the portable device and the server, and can also be applied to an interactive system formed by a transfer device and a server. Among them, the portable device is used to represent a working device that needs to be connected to different workstations in multiple locations, resulting in different IP addresses during different working periods. In some embodiments, for ease of understanding, taking the medical field as an example, the portable device can be an ultrasound device, and correspondingly, the workstation can be a workstation of different departments in the hospital, and the transfer device can be a data acquisition box in the hospital, and the data acquisition box can be bound to one or more ultrasound devices.
[0056] The following uses the log file acquisition method applied to the same execution entity, such as a transfer device that can directly communicate with a mobile device, or a server that can directly communicate with a mobile device as an example to illustrate the log file acquisition method provided in some embodiments of the present application.
[0057] like Figure 1 As shown, Figure 1 : is a flow chart of a method for obtaining a log file according to an exemplary embodiment of the present application. The method for obtaining a log file provided in the embodiment of the present application includes:
[0058] In step S100, an initial IP address corresponding to a target device identifier of a target portable device is obtained based on a backup mapping relationship;
[0059] In step S200, the actual device identification of the portable device accessed through the initial IP address is obtained;
[0060] In step S301, when the target device identifier and the actual device identifier are the same, a device log file of the target portable device is obtained;
[0061] In step S302, when the target device identifier and the actual device identifier are different, the target IP address corresponding to the target device identifier is queried from the real-time mapping relationship, and the device log file of the target mobile device is obtained through the target IP address; wherein, the data immediacy of the real-time mapping relationship is higher than that of the backup mapping relationship.
[0062] Before the first application of this method, all IP addresses available to the mobile devices in the application environment will be pre-configured in the execution subject of the method, and the device identification of each mobile device and its IP address when it is connected to the network can be associated and stored during configuration to form a mapping relationship between the device identification and the IP address, which can be understood as the backup mapping relationship mentioned above. The mapping relationship can be stored in the form of a local list or in the form of text, which is not limited in the embodiment of the present application.
[0063] Since the work location of the portable device will change according to the work requirements, which will cause the IP address to change, therefore, in order to ensure that the log file of the target portable device can be obtained through the correct IP address, the mapping relationship between the device identification of the portable device and the IP address can be updated in real time or regularly during the operation of the portable device, and stored. The mapping relationship here can be understood as the real-time mapping relationship mentioned above, and its data immediacy is higher than that of the backup mapping relationship; in some embodiments, in order to ensure the data immediacy of the real-time mapping relationship, it can be stored in the cache. Similarly, the real-time mapping relationship can be stored in the form of a list or in the form of text, as long as the normal reading of the data can be achieved, and the embodiments of the present application do not limit this.
[0064] Therefore, when it is necessary to periodically obtain the device log files of all or part of the portable devices, or when it is found that the device log files of some portable devices are not up to date, the above steps S100 to S302 can be used to obtain the required device log files of the target portable device. Among them, the corresponding initial IP address can be first obtained from the backup mapping relationship according to the target device identifier of the target portable device, and then the initial IP address is accessed to obtain the actual device identifier of the portable device currently connected to the initial IP address, and then the target device identifier and the actual device identifier are verified to determine whether the portable device accessed through the initial IP address is the target portable device, thereby ensuring that the device log files of the target portable device can be accurately obtained later. After the verification, if the target device identifier is the same as the actual device identifier, it means that the portable device accessed through the initial IP address is indeed the target portable device. At this time, the device log file of the target portable device can be obtained by accessing the initial IP address; if the target device identifier is different from the actual device identifier, it means that the IP address of the target portable device has changed. At this time, the target IP address corresponding to the target device identifier will be further queried from the real-time mapping relationship. The target IP address can be understood as the IP address that can currently access the target portable device. After obtaining the target IP address, the device log file of the target portable device can be obtained by accessing the target IP address.
[0065] In summary, the present application adds pre-processing logic before obtaining the log file - first obtain the initial IP address corresponding to the target device identifier of the target portable device based on the backup mapping relationship, then obtain the actual device identifier of the portable device accessed through the initial IP address, and then verify the target device identifier and the actual device identifier. If the target device identifier and the actual device identifier are the same, it means that the device accessed through the initial IP address is indeed the target portable device, and the device log file of the target portable device can be obtained by accessing the initial IP address. If the target device identifier and the actual device identifier are different, it means that the device accessed through the initial IP address is not the target portable device, and the IP of the target portable device has changed. At this time, the target IP address corresponding to the target device identifier will be queried from the real-time mapping relationship with higher data immediacy, that is, the IP address that can access the target portable device is found, and then the device log file of the target portable device can be obtained by accessing the target IP address. Therefore, even if the IP address of the target portable device changes, the actual IP address of the target portable device can still be determined through the present application, thereby ensuring the acquisition of the device log file of the target portable device, while also improving the accuracy of the acquisition of the device log file, which is conducive to the subsequent accurate analysis of the device usage of the target portable device based on the correct device log file.
[0066] Among them, the initial IP address corresponding to the target device identifier is first obtained from the backup mapping relationship, and when the actual device identifier of the mobile device actually connected to the IP address obtained by accessing the initial IP address is different from the target device identifier, the target IP address corresponding to the target device identifier is queried from the real-time mapping relationship. This is beneficial to avoid the computational burden caused by directly accessing the real-time mapping relationship and the cache storing the real-time mapping relationship.
[0067] When the initial IP address obtained in the backup mapping relationship is incorrect, the above scheme further searches for the target IP address corresponding to the target device identifier from the real-time mapping relationship, and directly uses the target IP address as the address that can currently access the target portable device. However, in some cases, such as when the real-time mapping relationship is updated before the IP address of the target portable device changes, that is, before there is enough time to update the mapping relationship between the device identifier of the target portable device and its changed IP address, the IP address recorded in the real-time mapping relationship may still be the initial IP address. Obviously, the IP address is inaccurate. Therefore, in order to further improve the accuracy of the target IP address and to more accurately obtain the device log file of the target portable device, in some embodiments, the present application improves the method for obtaining the target IP address. Accordingly, Figure 2 As shown, Figure 2: is a flowchart of another log file acquisition method according to an exemplary embodiment of the present application. In step S302, querying the target IP address corresponding to the target device identifier from the real-time mapping relationship may include the following steps:
[0068] In step S3021, based on the target device identifier, the real-time IP address corresponding to the target device identifier is queried from the real-time mapping relationship;
[0069] In step S3022, when the real-time IP address is different from the initial IP address, the real-time IP address is determined to be the target IP address.
[0070] Therefore, after querying the real-time IP address corresponding to the target device identifier in the real-time mapping relationship, the real-time IP address is further compared with the initial IP address. The real-time IP address is used as the target IP address only when the two are different. This helps to avoid the situation where the target IP address is still the initial IP address, which helps to improve the accuracy of the target IP address and increase the guarantee for more accurate acquisition of the device log files of the target mobile device.
[0071] Although the above embodiment can improve the accuracy of the target IP address to a certain extent, in other cases, the target IP address obtained by the above embodiment may be other inaccurate IP addresses. It can be understood that it is possible that the portable device accessed through the target IP address is not the target portable device. Therefore, in order to solve this technical problem and further improve the accuracy of the target IP address, in some embodiments, after obtaining the target IP address, the target IP address is first verified, and then the device log file of the target portable device is obtained after the verification is passed. Accordingly, before obtaining the device log file of the target portable device through the target IP address, the log file acquisition method in some embodiments of the present application may also include the following steps:
[0072] In step S3023, the actual device identification of the portable device accessed through the target IP address is obtained;
[0073] Accordingly, in step S302, the step of obtaining the device log file of the target mobile device through the target IP address is performed when the target device identifier and the actual device identifier of the mobile device accessed through the target IP address are the same. On the contrary, when the target device identifier and the actual device identifier of the mobile device accessed through the target IP address are different, the step of querying the target IP address corresponding to the target device identifier from the real-time mapping relationship is returned to be performed until the correct target IP address is found.
[0074] In some embodiments, in order to avoid the situation in which the target IP address is incorrect and the log file acquisition efficiency of the remaining portable devices is affected by the re-search in the previous embodiment, or the execution falls into an infinite loop, the log file acquisition method in some embodiments of the present application may also include: if the target IP address corresponding to the target device identifier is still not found after the real-time mapping relationship is queried, the acquisition of the device log file of the target portable device is abandoned, and the acquisition of the device log file of the next target portable device is performed, that is, the next portable device for which the device log file needs to be obtained is used as the new target portable device, and the step of determining the device identifier of the target portable device for which the device log file needs to be obtained is returned to execute a new round of the log file acquisition method steps.
[0075] Although the above embodiment can avoid the problems of low efficiency and execution falling into an infinite loop caused by multiple searches for the target IP address, the mapping relationship between the IP address and the device identifier stored in the real-time mapping relationship is highly immediate, and the IP address and the device identifier are a one-to-one mapping relationship. Therefore, generally speaking, as long as a search is unsuccessful, the real-time mapping relationship will not be updated after this search. Even if the target IP address is searched again from the real-time mapping relationship, the re-searched target IP address will be the same as the target IP address found last time. In this way, multiple searches for the target IP address are meaningless, which is not only time-consuming and laborious, but also imposes a certain burden on the computing system. Therefore, in order to solve this technical problem, in some embodiments, when the target IP address is inaccurate or cannot be found, the real-time mapping relationship can be incrementally updated to timely update the mapping relationship between the device identifier and the IP address at this time, thereby improving the efficiency of searching for the correct target IP address. Therefore, if Figure 3 As shown, Figure 3 FIG. 4 is a flow chart of another method for obtaining a log file according to an exemplary embodiment of the present application. The method for obtaining a log file in some embodiments of the present application may further include the following steps:
[0076] In step S400, when the real-time IP address corresponding to the target device identifier is not recorded in the real-time mapping relationship, or the real-time IP address is the same as the initial IP address, or the target IP address determined based on the real-time IP address cannot access the target portable device, the device identifier corresponding to the initial IP address in the real-time mapping relationship is updated to the actual device identifier, and the original IP address corresponding to the actual device identifier is obtained from the real-time mapping relationship as the IP address to be updated;
[0077] In step S500, the device identifier to be updated of the mobile device accessed through the IP address to be updated is obtained, the device identifier corresponding to the IP address to be updated in the real-time mapping relationship is updated to the device identifier to be updated, and the original IP address corresponding to the device identifier to be updated is obtained from the real-time mapping relationship as the next IP address to be updated. Repeat this step until the real-time IP address corresponding to the target device identifier is obtained.
[0078] The following describes the log file acquisition method in the embodiment including step S400 and step S500 in combination with an example:
[0079] Assuming that the device log file of the A001 device is to be obtained, through the log file acquisition method of this embodiment, the corresponding initial IP address is first searched in the backup mapping relationship according to the target device identification of the A001 device, and then the initial IP address (taking 10.1.1.1 as an example) is accessed to obtain the actual device identification of the mobile device accessed by the initial IP address; then the target device identification and the actual device identification are verified. If the two are the same, the device log file of the A001 device can be directly obtained through the initial IP address. If the two are different, the latest IP address of the A001 device is queried in the real-time mapping relationship. Because the data in the real-time mapping relationship is more timely than the backup mapping relationship, the relationship between the device identification and the IP address stored therein is relatively new, so it is considered that the latest IP address of the A001 device can be queried from the real-time mapping relationship. At this time, in order to ensure the query efficiency and accuracy, the query can be based on three parameters, namely: the target device identification of the A001 device, the initial IP address 10.1.1.1, and the actual device identification of the A002 device accessed through the initial IP address. During the query process, if the real-time IP address corresponding to the target device identifier of the A001 device found is different from the initial IP address 10.1.1.1, it is considered that the target IP address has been found, and then the device log file of the A001 device can be obtained through the target IP address, or step S3023 can be used to further verify whether the target IP address is correct, and if it is correct, the device log file of the A001 device can be obtained. When the target IP address is incorrect, or when the real-time IP address corresponding to the A001 device is not found after querying the entire real-time mapping relationship, or when the real-time IP address found is consistent with the initial IP address 10.1.1.1, the execution of steps S400 and S500 will be triggered. At this time, the incremental update mode of the real-time mapping relationship will be entered, involving the following updates:
[0080] First, change the device ID corresponding to the initial IP address 10.1.1.1 in the real-time mapping relationship from the device ID of the A001 device to the device ID of the A002 device;
[0081] Second, from the real-time mapping relationship, obtain the original IP address corresponding to the device identifier of the A002 device (taking 10.1.1.2 as an example), and then access the device identifier of the connected portable device through the IP address 10.1.1.2. If the accessed device identifier is the device identifier of the A003 device, the device identifier corresponding to the IP address 10.1.1.2 in the real-time mapping relationship is modified to the device identifier of the A003 device; then, obtain the original IP address corresponding to the device identifier of the A003 device (taking 10.1.1.3 as an example), and also access the device identifier of the connected portable device through the IP address 10.1.3. If the accessed device identifier is the device identifier of the A004 device, the device identifier corresponding to IP10.1.1.3 in the real-time mapping relationship is modified to the device identifier of the A004 device; this cycle is repeated until the IP address corresponding to the A001 device is found, and the incremental update ends.
[0082] When the IP address corresponding to the A001 device is found through the above process, the device log file of the A001 device can be obtained based on the IP address of the A001 device, thereby achieving the acquisition of the device log file of the target mobile device.
[0083] Therefore, the scheme of the previous embodiment triggers an incremental update when the target IP address is incorrect, or when the real-time IP address corresponding to the target portable device is not found after querying the entire real-time mapping relationship, or when the queried real-time IP address is consistent with the initial IP address. It can be understood as updating the mapping relationship in the real-time mapping relationship table until the IP address to which the target portable device is connected is obtained. This can ensure that the target IP address of the target portable device obtained based on the updated mapping relationship is the correct IP address, which is beneficial to improving the efficiency of obtaining the device log file of the target portable device and avoiding invalid work caused by multiple queries of the real-time mapping relationship that has not been updated.
[0084] It should be noted that after all mapping relationships in the real-time mapping relationship are updated through the incremental update mode, it is still possible that the IP address corresponding to the target mobile device cannot be found. This situation is generally caused by the target mobile device being in an offline state, where the offline state means that the device is turned off or disconnected. Therefore, in order to increase the possibility of obtaining the device log file of the target mobile device in this situation, in some embodiments, the log file acquisition method of the present application may also include:
[0085] In step S600, after the real-time mapping relationship is updated, if the target IP address corresponding to the target device identifier is still not found from the real-time mapping relationship, it is determined that the target portable device is in an offline state, and a reminder message is sent to the terminal device associated with the target portable device. The reminder message is used to remind the user to connect the target portable device to the network so that the target portable device is online.
[0086] In addition, in the process of updating the real-time mapping relationship through the incremental update mode, the IP address to be updated may be blocked due to the device being offline. It can be understood that no portable device can be accessed through the IP address to be updated. At this time, if the IP address corresponding to the target portable device has not been obtained, and no remedial measures have been taken, the update of the real-time mapping relationship will be stagnant, and the acquisition of the IP address of the target portable device will be in a long-term interrupted state, so that the device log file of the target portable device cannot be obtained. Therefore, in order to solve this technical problem, in some embodiments, the mapping relationship update operation for the IP address that cannot access any portable device can be skipped, and the IP address of the remaining device identifiers whose IP addresses have not been updated in the real-time mapping relationship table can be updated. At this time, the full update mode will be triggered. Accordingly, the log file acquisition method of the present application can also include the following steps:
[0087] In step S700, during the process of updating the real-time mapping relationship, if any portable device is not accessed based on the IP address to be updated, the IP addresses of the remaining device identifiers whose IP addresses have not been updated in the real-time mapping relationship are updated.
[0088] Through step S700, in the process of updating the real-time mapping relationship, if it is found that any portable device cannot be accessed based on the current IP address to be updated, it means that the IP address is not connected to the portable device. Therefore, in order to ensure the continued acquisition of the target portable device, the current IP address to be updated can be skipped, and the IP addresses corresponding to the remaining device identifiers of the unupdated IP addresses are selected from the real-time mapping relationship, and accessed one by one to determine what the device identifiers that can be accessed through each remaining IP address are, and the original device identifiers corresponding to the remaining IP addresses in the real-time mapping relationship are modified to the device identifiers of the portable devices that can be actually accessed, until the update of the device identifiers corresponding to all the remaining IP addresses is completed, at which time the full update is completed.
[0089] Although the full update mode can be used to fully update the real-time mapping relationship, it is possible that the IP address is not accessible, or the mobile device is connected to an IP address in the current application environment that is not recorded in the real-time mapping relationship, which may cause some device identifiers in the updated real-time mapping relationship to be missing. This can be understood as some device identifiers in the updated real-time mapping relationship that are not associated with the IP address. Therefore, in order to obtain a more complete real-time mapping relationship and more accurately determine the connection status or power-on and power-off status of the mobile device that is not associated with the IP address, so as to effectively improve the acquisition of the device log file of the mobile device, in some embodiments, before or during the first execution of the log file acquisition method of the present application, an IP address list can be pre-configured and maintained in a timely manner. The IP address list records all IP addresses provided by the application environment where the present application is located. Based on this, the log file acquisition method of the present application may also include the following steps:
[0090] In step S801, if there are still pending device identifiers that do not correspond to IP addresses in the real-time mapping relationship after being updated in the full update mode, the unloaded IP addresses that are not recorded in the real-time mapping relationship are determined based on the IP address list and the real-time mapping relationship, and the pending device identifiers of the pending devices accessed through the unloaded IP addresses are obtained;
[0091] In step S802, when the device identification to be processed is the same as the device identification to be determined, the IP address of the device identification to be processed is modified to the unloaded IP address corresponding to the device identification to be determined in the real-time mapping relationship;
[0092] In step S802, when the device identification to be processed and the device identification to be determined are different, it is determined that the portable device corresponding to the device identification to be processed is in an offline state, and a reminder message is sent to a terminal device associated with the portable device corresponding to the device identification to be processed.
[0093] It can be seen from the above technical solution that no matter it is the incremental update mode or the full update mode, it is triggered by searching for the IP address corresponding to the target mobile device based on the real-time mapping relationship, and this triggering starts with the acquisition of the device log file of the target mobile device, but the acquisition of the device log file is generally generated when there is a demand or when it is found that the log update time is significantly different from the last update. Therefore, if only relying on this method to update the real-time mapping relationship, it is very likely to cause the mapping relationship in the real-time mapping relationship to be in a lagging state, which is not conducive to the subsequent rapid query of the IP addresses corresponding to other target mobile devices, thereby affecting the efficiency of obtaining the device log file. Therefore, in order to solve this technical problem and to ensure the immediacy of the real-time mapping relationship, in some embodiments, the present application also provides another triggering scheme for the full update mode, that is, the log file acquisition method of the present application can also include the following steps:
[0094] In step S901, all IP addresses in the real-time mapping relationship are accessed at a set period to obtain the device identification of the portable device connected when each IP address is accessed;
[0095] In step S902, the real-time mapping relationship is updated according to the device identifications and IP addresses of all the mobile devices.
[0096] In the above, the setting period can be determined based on actual usage experience or actual needs, and this application does not limit this.
[0097] In some embodiments, in order to ensure the validity of the backup mapping relationship, after obtaining the target IP address corresponding to the target mobile device through the real-time mapping relationship, the target IP address corresponding to the target mobile device in the backup mapping relationship can be updated, so that in the subsequent process, when the IP address of the target mobile device has not changed relative to the target IP address, the IP address of the target mobile device can be directly obtained through the backup mapping relationship without further accessing the real-time mapping relationship, so as to improve the efficiency of accurate IP address acquisition, and also reduce the access to the cache space or other storage space storing the mapping relationship. Based on this, while or after obtaining the device log file of the target mobile device through the target IP address, the log acquisition method of the present application can also include the following steps:
[0098] In step S1000, the IP address corresponding to the target device identifier in the backup mapping relationship is updated to the target IP address.
[0099] In addition, since the real-time mapping relationship only stores the latest mapping relationship between the device identifier and the IP address, and does not record all IP address changes involved in the working process of the mobile device, in some scenarios where the overall working status of the mobile device needs to be analyzed in combination with the workstation, for example, in a hospital, it is necessary to combine the workstation log file of the workstation and the device log file of the mobile device to analyze the overall use of the device. Since the IP address changes of the mobile device are not recorded, the mobile device cannot be mapped to the actual connected workstation in certain periods, thereby affecting the analysis of the overall use of the device. To solve this technical problem, in some embodiments, the present application also maintains a database, which records the mapping relationship between the device identifier and the IP address, the mapping relationship between the IP address and the workstation, and the mapping relationship between the IP address and the time information. The time information refers to the time when the mapping relationship between the device identifier and the IP address is updated. Accordingly, the log acquisition method of the present application may also include the following steps:
[0100] In step S1000, the mapping relationship between the device identification and the IP address in the database is updated according to the updated real-time mapping relationship, and the update time of the IP address is recorded.
[0101] Therefore, after each update of the real-time mapping relationship, the mapping relationship between the device identification and the IP address in the database can be updated in time, and by recording the update time of the IP address, the mapping relationship between the IP address and the time information is also updated.
[0102] From the above records, it can be known that when the IP is not connected, the portable device may be offline. If the target portable device is also offline, it will affect the acquisition of the device log file. Therefore, in order to ensure the efficiency or success rate of acquiring the device log file of the target portable device to a certain extent, the offline portable device can be determined in advance and timely remedial measures can be taken. Based on this, in some embodiments, the log file acquisition method of the present application can also include the following steps:
[0103] In step S1101, a heartbeat packet is sent to all mobile devices at a fixed time, and the sending status information of the heartbeat packet is obtained;
[0104] In step S1102, the disconnected IP address where the heartbeat packet fails to be sent is determined based on the sending status information, and the most recent disconnected device identifier is determined from the database based on the disconnected IP address;
[0105] In step S1103, a reminder message is sent to the terminal device associated with the portable device corresponding to the disconnected device identifier.
[0106] Among them, the reminder information has the same function as the reminder information mentioned above, which will not be repeated here.
[0107] Although the above-mentioned solution to the IP disconnection problem can meet the device access reminder requirements in most cases, in some cases, the most recent disconnected device identifier determined from the database through the disconnected IP address is not necessarily the device identifier of the disconnected portable device, because it is possible that the portable device corresponding to the disconnected device identifier has been moved to another workplace to continue working. Therefore, in order to improve the accuracy of determining the disconnected portable device, in some embodiments, the present application provides another solution to the IP disconnection problem, which includes the following steps:
[0108] In step S1201, a heartbeat packet is sent to all mobile devices at a fixed time, and the sending status information of the heartbeat packet is obtained;
[0109] In step S1202, the online IP addresses to which the heartbeat packets are successfully sent are determined based on the sending status information, and the online device identifiers of the portable devices currently connected to each online IP address are obtained;
[0110] In step S1203, based on all online device identifiers and all device identifiers recorded in the database, the disconnected device identifier for which the heartbeat packet fails to be sent is determined;
[0111] In step S1204, a reminder message is sent to the terminal device associated with the portable device corresponding to each disconnected device identifier.
[0112] After obtaining the device log file of the target portable device through any of the above embodiments, the device log file can be analyzed according to actual application needs to understand the usage of the target portable device. However, in order to meet more application scenarios, such as some scenarios that need to be associated with a workstation to analyze the overall work situation, for example, in the hospital field, the ultrasound device as a portable device cannot count the number of examinations by itself. Only after integrating with the workstation log file of the workstation can the workload of the ultrasound device be known. Therefore, in order to meet the usage requirements of this application scenario, in some embodiments, such as Figure 4 As shown, Figure 4 is a flowchart of another method for obtaining a log file according to an exemplary embodiment of the present application. After obtaining the device log file, the log file obtaining method of the present application may further include the following steps:
[0113] In step S13011, based on the time information in the device log file, the working IP address corresponding to the time information is obtained from the database; the database stores the mapping relationship between the device identifier and the IP address, the IP address and the time information, and the workstation identifier and the IP address;
[0114] In step S13012, the corresponding workstation log file is obtained based on the working IP address, and the log content of the corresponding time information in the workstation log file is associated with the log content of the corresponding time information in the device log file and stored.
[0115] Therefore, through steps S13011 and S13012, the corresponding log contents in the device log file and the workstation log file can be integrated, and the integrated contents can form a new log file and be stored.
[0116] In addition, in some other embodiments, Figure 5 As shown, Figure 5is a flow chart of another method for obtaining a log file according to an exemplary embodiment of the present application. The present application also provides another way to integrate the device log file and the workstation log file. That is, after obtaining the device log file, the log file obtaining method of the present application may further include the following steps:
[0117] In step S13021, a workstation log file and a workstation identifier of the workstation are obtained;
[0118] In step S13022, based on the workstation identifier, the corresponding workstation IP address is obtained from a pre-stored database, and based on the time information in the workstation log file, the working device identifier corresponding to the workstation IP address at the time information is obtained from the database; the database stores the mapping relationship between the device identifier and the IP address, the IP address and the time information, and the workstation identifier and the IP address;
[0119] In step S13023, the working device log file of the corresponding mobile device is obtained based on the working device identification, and the log content of the corresponding time information in the working device log file is associated with the log content of the corresponding time information in the workstation log file and stored.
[0120] Therefore, through another workstation log file and device log file integration method recorded in steps S13021 to S13023, the integration of related contents in the workstation log file and the device log file can also be achieved.
[0121] The log file acquisition method recorded in any of the above embodiments is executed by the same execution subject. Since the execution subject can be a transfer device or a server, when the execution subject is a server, if the server is not set in the intranet, it means that the server can remotely access the intranet to directly communicate with the mobile device. However, in some application scenarios with high requirements for intranet security, for example, in hospitals, in order to avoid leakage of user medical data or other confidential data, external servers are generally not allowed to directly access ultrasound equipment or workstations as mobile devices. At this time, in order to ensure that the server can successfully obtain some data, a transfer device is generally deployed between the server and the mobile device or workstation to enable the server to communicate with the mobile device or workstation through the transfer device. Among them, the transfer device can be a data acquisition box, but is not limited to this.
[0122] Based on this, the log file acquisition method of the present application will be adaptively adjusted according to the current communication architecture, that is, the communication architecture in which the server communicates with the mobile device or workstation through the transfer device. First, the relevant steps involved in the log file acquisition method of the present application are explained from the perspective of the transfer device.
[0123] like Figure 6 As shown, Figure 6 This is a flow chart of a log file acquisition method applied to a transfer device according to an exemplary embodiment of the present application. The log file acquisition method in this embodiment is applied to a transfer device, and the transfer device is used to establish communication between a server and a mobile device. The log file acquisition method includes:
[0124] In step SA100, the IP address corresponding to the target device identifier of the target mobile device is obtained based on the pre-stored local mapping relationship; the local mapping relationship is stored in the transfer device;
[0125] In step SA200, the actual device identification of the portable device accessed through the IP address is obtained;
[0126] In step SA301, when the target device identifier and the actual device identifier are the same, a device log file of the target portable device is obtained;
[0127] In step SA302, when the target device identifier and the actual device identifier are different, an IP query request of the target portable device is sent to the server; the server stores a real-time mapping relationship between portable devices and IP addresses;
[0128] In step SA400, when the target IP address fed back by the server based on the IP query request is received, the device log file of the target mobile device is obtained through the target IP address.
[0129] In the above step SA100, the role of the local mapping relationship is equivalent to the backup mapping relationship mentioned above. The local mapping relationship can also be stored in the transfer device in the form of a local list or a local file, and this application does not limit this.
[0130] In addition, for understanding of the above steps SA100 to SA400, reference may be made to the relevant records above, which will not be elaborated here.
[0131] Although the above embodiment can improve the accuracy of the target IP address to a certain extent, in other cases, the target IP address obtained by the above embodiment may be other inaccurate IP addresses. It can be understood that it is possible that the portable device accessed through the target IP address is not the target portable device. Therefore, in order to solve this technical problem and further improve the accuracy of the target IP address, in some embodiments, after obtaining the target IP address, the target IP address is first verified, and then the device log file of the target portable device is obtained after the verification is passed. Accordingly, before obtaining the device log file of the target portable device through the target IP address, the log file acquisition method in some embodiments of the present application may also include the following steps:
[0132] In step SA401, the actual device identification of the portable device accessed through the target IP address is obtained;
[0133] Accordingly, in step S400, the step of obtaining the device log file of the target mobile device through the target IP address is performed when the target device identifier and the actual device identifier of the mobile device accessed through the target IP address are the same. On the contrary, when the target device identifier and the actual device identifier of the mobile device accessed through the target IP address are different, the step of querying the target IP address corresponding to the target device identifier from the real-time mapping relationship is returned to be performed until the correct target IP address is found.
[0134] In some embodiments, in order to avoid re-searching in the previous embodiment when the target IP address is incorrect, thereby affecting the efficiency of obtaining log files of the remaining portable devices, or executing an infinite loop, the log file acquisition method in some embodiments of the present application may also include: upon receiving the failure information fed back by the server based on the IP query request, determining that the next portable device for which the device log file needs to be obtained is the target portable device, and returning to the step of determining the target device identifier of the target portable device for which the device log file needs to be obtained. The failure information indicates the information fed back to the transfer device when the server fails to find the target IP address corresponding to the target device identifier.
[0135] When the server fails to find the target IP address corresponding to the target device identifier, it is possible that the target portable device is offline. Therefore, in order to increase the possibility of obtaining the device log file of the target portable device in this case, in some embodiments, the log file acquisition method of the present application may further include:
[0136] In step SA600, when failure information fed back by the server based on the IP query request is received, it is determined that the target portable device is in an offline state, and a reminder message is sent to the terminal device associated with the target portable device.
[0137] In some embodiments, in order to ensure the validity of the local mapping relationship, after obtaining the target IP address corresponding to the target mobile device through the server, the target IP address corresponding to the target mobile device in the local mapping relationship can be updated, so that in the subsequent process, when the IP address of the target mobile device has not changed relative to the target IP address, the IP address of the target mobile device can be directly obtained through the local mapping relationship without further accessing the server, so as to improve the efficiency of accurate IP address acquisition, and also reduce the number of visits to the server, so as to avoid affecting the efficiency of device log file acquisition due to network unsmoothness. Based on this, while or after obtaining the device log file of the target mobile device through the target IP address, the log acquisition method of the present application can also include the following steps:
[0138] In step SA1000, the IP address corresponding to the target device identifier in the local mapping relationship is updated to the target IP address.
[0139] After obtaining the device log file of the target mobile device through any of the above embodiments, the device log file can be analyzed according to actual application needs to understand the usage of the target mobile device. However, in order to meet more application scenarios, such as some scenarios that need to be associated with a workstation to analyze the overall work situation, for example, in the hospital field, the ultrasound device as a mobile device cannot count the number of examinations by itself, and the workload of the ultrasound device can only be known after integration with the workstation log file of the workstation. Therefore, in order to meet the usage requirements of this application scenario, in some embodiments, after obtaining the device log file, the log file acquisition method of the present application may also include the following steps:
[0140] In step SA13011, based on the time information in the device log file, the working IP address corresponding to the time information is obtained from the database of the server; the database stores the mapping relationship between the device identifier and the IP address, the IP address and the time information, and the workstation identifier and the IP address;
[0141] In step SA13012, the corresponding workstation log file is obtained based on the working IP address, and the log content of the corresponding time information in the workstation log file is associated with the log content of the corresponding time information in the device log file and stored.
[0142] Therefore, through steps SA13011 and SA13012, the corresponding log contents in the device log file and the workstation log file can be integrated, and the integrated contents can form a new log file and be stored.
[0143] In addition, in some other embodiments, the present application also provides another method for integrating the device log file and the workstation log file, that is, after obtaining the device log file, the log file obtaining method of the present application may further include the following steps:
[0144] In step SA13021, a workstation log file and a workstation identifier of the workstation are obtained;
[0145] In step SA13022, the corresponding workstation IP address is obtained from the database of the server based on the workstation identifier, and the working device identifier corresponding to the workstation IP address at the time information is obtained from the database of the server based on the time information in the workstation log file; the database stores the mapping relationship between the device identifier and the IP address, the IP address and the time information, and the workstation identifier and the IP address;
[0146] In step SA13023, the working device log file of the corresponding mobile device is obtained based on the working device identification, and the log content of the corresponding time information in the working device log file is associated with the log content of the corresponding time information in the workstation log file and stored.
[0147] Therefore, through another workstation log file and device log file integration method recorded in steps SA13021 to SA13023, the integration of related contents in the workstation log file and the device log file can also be achieved.
[0148] The above records the relevant schemes of the log file acquisition method applied to the transfer device. The following will further introduce the log file acquisition method executed by the server that interacts with the transfer device to jointly realize the log file acquisition:
[0149] like Figure 7 As shown, Figure 7 The present application is a flowchart of a method for obtaining a log file applied to a server according to an exemplary embodiment; the method for obtaining a log file in this embodiment is applied to a server, and the server communicates with a mobile device through a transfer device. The method for obtaining a log file includes:
[0150] In step SB100, when an IP query request of a target mobile device sent by a transfer device is received, the target device identifier, initial IP address and actual device identifier contained in the IP query request are obtained; wherein the target device identifier represents the device identifier of the target mobile device, the initial IP address represents the IP address corresponding to the target device identifier queried by the transfer device based on its pre-stored local mapping relationship, and the actual device identifier represents the device identifier of the mobile device actually accessed by the transfer device based on the initial IP address;
[0151] In step SB200, based on the target device identifier, the real-time IP address corresponding to the target device identifier is queried from the pre-stored real-time mapping relationship;
[0152] In step SB300, when the real-time IP address is different from the initial IP address, the real-time IP address is fed back to the transfer device, and the real-time IP address is used for the transfer device to access the target mobile device to obtain the device log file of the target mobile device.
[0153] For understanding of the above steps SB100 to SB300, please refer to the relevant records above, which will not be repeated here.
[0154] Although the above scheme is explained from the perspective of being able to find the implementation IP address corresponding to the target device identifier from the real-time mapping relationship, in some cases, it may not be possible to query the real-time IP address corresponding to the target device identifier from the real-time mapping relationship. At this time, in order to increase the possibility of querying the real-time IP address corresponding to the target device identifier from the real-time mapping relationship, in some embodiments, the log file acquisition method of this embodiment may also include the following steps:
[0155] In step SB400, when the real-time IP address is not recorded in the real-time mapping relationship, or the real-time IP address is the same as the initial IP address, or the target IP address determined based on the real-time IP address cannot access the target mobile device, the device identifier corresponding to the initial IP address in the real-time mapping relationship is updated to the actual device identifier, and the original IP address corresponding to the actual device identifier is obtained from the real-time mapping relationship as the IP address to be updated;
[0156] In step SB500, the device identifier to be updated of the mobile device accessed through the IP address to be updated is obtained through the transit device, the device identifier corresponding to the IP address to be updated in the real-time mapping relationship is updated to the device identifier to be updated, and the original IP address corresponding to the device identifier to be updated is obtained from the real-time mapping relationship as the next IP address to be updated, and this step is repeated until the real-time IP address is obtained.
[0157] Regarding step SB400 and step SB500, it can be understood that the server updates the real-time mapping relationship through the incremental update mode. Please refer to the relevant records above and no further details will be given here.
[0158] In the process of updating the real-time mapping relationship through the incremental update mode, the IP address to be updated may be blocked due to the device being offline. It can be understood that no portable device can be accessed through the IP address to be updated. At this time, if the IP address corresponding to the target portable device has not been obtained, and no remedial measures have been taken, the update of the real-time mapping relationship will be stagnant, and the acquisition of the IP address of the target portable device will be in a long-term interrupted state, so that the device log file of the target portable device cannot be obtained. Therefore, in order to solve this technical problem, in some embodiments, the mapping relationship update operation for the IP address that cannot access any portable device can be skipped, and the IP address of the remaining device identifiers whose IP addresses have not been updated in the real-time mapping relationship table can be updated. At this time, the full update mode will be triggered. Accordingly, the log file acquisition method of this embodiment can also include the following steps:
[0159] In step SB700, during the process of updating the real-time mapping relationship, if any portable device is not accessed based on the IP address to be updated, the IP addresses of the remaining device identifiers whose IP addresses have not been updated in the real-time mapping relationship are updated.
[0160] The above step SB700 can be understood as the server updating the real-time mapping relationship through the full update mode. Please refer to the relevant records above and will not be repeated here.
[0161] It can be seen from the above technical solution that no matter it is the incremental update mode or the full update mode, it is triggered by searching for the IP address corresponding to the target mobile device based on the real-time mapping relationship, and this triggering starts with the acquisition of the device log file of the target mobile device, but the acquisition of the device log file is generally generated when there is a demand or when it is found that the log update time is significantly different from the last update. Therefore, if only relying on this method to update the real-time mapping relationship, it is very likely to cause the mapping relationship in the real-time mapping relationship to be in a lagging state, which is not conducive to the subsequent rapid query of the IP addresses corresponding to other target mobile devices, thereby affecting the efficiency of obtaining the device log file. Therefore, in order to solve this technical problem and to ensure the immediacy of the real-time mapping relationship, in some embodiments, the present application also provides another triggering scheme for the full update mode, that is, the log file acquisition method of the present application can also include the following steps:
[0162] In step SB901, all IP addresses in the real-time mapping relationship are accessed at a set period to obtain the device identification of the portable device connected when each IP address is accessed;
[0163] In step SB902, the real-time mapping relationship is updated according to the device identifications and IP addresses of all mobile devices.
[0164] In addition, since the real-time mapping relationship only stores the latest mapping relationship between the device identifier and the IP address, and does not record all IP address changes involved in the working process of the mobile device, in some scenarios where the overall working status of the mobile device needs to be analyzed in combination with the workstation, for example, in a hospital, it is necessary to combine the workstation log file of the workstation and the device log file of the mobile device to analyze the overall use of the device. Since the IP address changes of the mobile device are not recorded, the mobile device cannot be mapped to the actual connected workstation in certain periods, thereby affecting the analysis of the overall use of the device. To solve this technical problem, in some embodiments, the present application also maintains a database, which records the mapping relationship between the device identifier and the IP address, the mapping relationship between the IP address and the workstation, and the mapping relationship between the IP address and the time information. The time information refers to the time when the mapping relationship between the device identifier and the IP address is updated. Accordingly, the log acquisition method of the present application may also include the following steps:
[0165] In step SB1000, the mapping relationship between the device identifier and the IP address in the database is updated according to the updated real-time mapping relationship, and the update time of the IP address is recorded; the database stores the device identifier and IP address, and the IP address and time information.
[0166] Therefore, after each update of the real-time mapping relationship, the mapping relationship between the device identification and the IP address in the database can be updated in time, and by recording the update time of the IP address, the mapping relationship between the IP address and the time information is also updated.
[0167] In addition, when the IP is not connected, the portable device may be offline. If the target portable device is also offline, it will affect the acquisition of the device log file. Therefore, in order to ensure the efficiency or success rate of acquiring the device log file of the target portable device to a certain extent, the offline portable device can be determined in advance and timely remedial measures can be taken. Based on this, in some embodiments, the log file acquisition method of the present application can also include the following steps:
[0168] In step SB1101, a heartbeat packet is periodically sent to all mobile devices through a transfer device, and the sending status information of the heartbeat packet is obtained;
[0169] In step SB1102, the disconnected IP address where the heartbeat packet fails to be sent is determined based on the sending status information, and the most recent disconnected device identifier is determined from the database based on the disconnected IP address; the database stores the device identifier and IP address, and the IP address and time information;
[0170] In step SB1103, a reminder message is sent to the terminal device associated with the portable device corresponding to the disconnected device identifier.
[0171] Among them, the reminder information has the same function as the reminder information mentioned above, which will not be repeated here.
[0172] Although the above-mentioned solution to the IP disconnection problem can meet the device access reminder requirements in most cases, in some cases, the most recent disconnected device identifier determined from the database through the disconnected IP address is not necessarily the device identifier of the disconnected portable device, because it is possible that the portable device corresponding to the disconnected device identifier has been moved to another workplace to continue working. Therefore, in order to improve the accuracy of determining the disconnected portable device, in some embodiments, the present application provides another solution to the IP disconnection problem, which includes the following steps:
[0173] In step SB1201, a heartbeat packet is periodically sent to all mobile devices through a transfer device, and the sending status information of the heartbeat packet is obtained;
[0174] In step SB1202, the online IP addresses to which the heartbeat packets are successfully sent are determined based on the sending status information, and the online device identifiers of the portable devices currently connected to each online IP address are obtained;
[0175] In step SB1203, based on all online device identifiers and all device identifiers recorded in the database, the disconnected device identifier that failed to send the heartbeat packet is determined; the database stores the device identifier and IP address, and the IP address and time information;
[0176] In step SB1204, a reminder message is sent to the terminal device associated with the portable device corresponding to each disconnected device identifier.
[0177] The real-time mapping relationship mentioned above can be stored in the cache of the server, which can improve the data reading efficiency of the server.
[0178] It should be noted that the log file acquisition method applied to the transfer device and the log file acquisition method applied to the server provided in the embodiments of the present application correspond to the log file acquisition method applied to the same execution subject provided in the embodiments of the present application. Therefore, for relevant matters, please refer to the implementation process of the corresponding steps in the log file acquisition method applied to the same execution subject, which will not be repeated here.
[0179] Corresponding to the embodiments of the log file acquisition method applied to a transfer device and the log file acquisition method applied to a server, the present application also provides a log file acquisition system, which includes a server, a transfer device communicatively connected to the server, and a portable device communicatively connected to the transfer device; wherein the transfer device is used to obtain the device log file of the target portable device for which the device log file needs to be obtained through the steps in the log file acquisition method applied to the transfer device; and the server is used to provide the transfer device with the data required to obtain the device log file through the steps in the log file acquisition method applied to the server.
[0180] In another embodiment, in order to meet more application scenarios, the log file acquisition system may further include a workstation, which is used to physically connect to the mobile device and communicate with the transfer device. The log file acquisition system may associate and store the workstation log file of the workstation with the relevant content in the device log file.
[0181] For the log file acquisition system, since it corresponds to the log file acquisition method applied to the transfer device and the log file acquisition method applied to the server provided in the embodiments of the present application, the relevant parts refer to the implementation process of the relevant contents in the above-mentioned related method embodiments, which will not be repeated here.
[0182] Corresponding to the aforementioned embodiment of the log file acquisition method applied to the same execution subject, the embodiment of the present application further provides a log file acquisition device, which is applied to the same execution subject, such as a transfer device or a server, and the log file acquisition device may include:
[0183] The first address acquisition module is configured to: acquire an initial IP address corresponding to a target device identifier of a target mobile device based on a backup mapping relationship;
[0184] A first identification acquisition module is configured to: acquire an actual device identification of the portable device accessed through the initial IP address;
[0185] The first log acquisition module is configured to: when the target device identifier and the actual device identifier are the same, obtain the device log file of the target mobile device; when the target device identifier and the actual device identifier are different, query the target IP address corresponding to the target device identifier from the real-time mapping relationship, and obtain the device log file of the target mobile device through the target IP address; wherein the data immediacy of the real-time mapping relationship is higher than that of the backup mapping relationship.
[0186] In some embodiments, the process of the first log acquisition module querying the target IP address corresponding to the target device identifier from the real-time mapping relationship includes: based on the target device identifier, querying the real-time IP address corresponding to the target device identifier from the real-time mapping relationship; when the real-time IP address is different from the initial IP address, determining that the real-time IP address is the target IP address.
[0187] In some embodiments, the log file obtaining device may further include:
[0188] A first updating module is configured to: when the real-time IP address is not recorded in the real-time mapping relationship, or the real-time IP address is the same as the initial IP address, or the target IP address determined based on the real-time IP address cannot access the target mobile device, update the device identifier corresponding to the initial IP address in the real-time mapping relationship to the actual device identifier, and obtain the original IP address corresponding to the actual device identifier from the real-time mapping relationship as the IP address to be updated;
[0189] Obtain the device identifier to be updated of the mobile device accessed through the IP address to be updated, update the device identifier corresponding to the IP address to be updated in the real-time mapping relationship to the device identifier to be updated, and obtain the original IP address corresponding to the device identifier to be updated from the real-time mapping relationship as the next IP address to be updated, and repeat this step until the real-time IP address corresponding to the target device identifier is obtained.
[0190] In some embodiments, the first update module is further configured to: during the process of updating the real-time mapping relationship, if no portable device is accessed based on the IP address to be updated, update the IP addresses of the remaining device identifiers whose IP addresses have not been updated in the real-time mapping relationship.
[0191] In some embodiments, the first update module is further configured to: access all IP addresses in the real-time mapping relationship at a set period to obtain the device identification of the portable device connected when each IP address is accessed; and update the real-time mapping relationship according to the device identification and IP address of all portable devices.
[0192] In some embodiments, the first updating module is further configured to: update the mapping relationship between the device identification and the IP address in the pre-stored database according to the updated real-time mapping relationship, and record the update time of the IP address.
[0193] In some embodiments, the first update module is further configured to: simultaneously or after acquiring the device log file of the target mobile device through the target IP address, update the IP address corresponding to the target device identifier in the backup mapping relationship to the target IP address.
[0194] In some embodiments, the first log acquisition module is further configured to: before acquiring the device log file of the target portable device through the target IP address, acquire the actual device identifier of the portable device accessed through the target IP address; and when the target device identifier and the actual device identifier of the portable device accessed through the target IP address are the same, execute the step of acquiring the device log file of the target portable device through the target IP address.
[0195] In some embodiments, the log file obtaining device further includes:
[0196] The first sending module is configured to: after the real-time mapping relationship is updated, if the target IP address corresponding to the target device identifier is still not queried from the real-time mapping relationship, determine that the target mobile device is in an offline state, and send a reminder message to the terminal device associated with the target mobile device.
[0197] In some embodiments, the log file acquisition module further includes:
[0198] The first heartbeat packet module is configured to: regularly send heartbeat packets to all mobile devices and obtain the sending status information of the heartbeat packets;
[0199] A first disconnected device determination module is configured to: determine the disconnected IP address where the heartbeat packet fails to be sent based on the sending status information, and determine the most recent disconnected device identifier from a pre-stored database based on the disconnected IP address; the database stores a mapping relationship between the device identifier and the IP address, and between the IP address and the time information;
[0200] The first reminder module is configured to send reminder information to the terminal device associated with the portable device corresponding to the disconnected device identifier.
[0201] As an alternative to the above embodiment, in some other embodiments, the log acquisition module may further include:
[0202] The first heartbeat packet module is configured to: regularly send heartbeat packets to all mobile devices and obtain the sending status information of the heartbeat packets;
[0203] The first disconnected device determination module is configured to: determine the online IP addresses to which the heartbeat packet is successfully sent based on the sending status information, and obtain the online device identification of the mobile device currently connected to each online IP address; determine the disconnected device identification to which the heartbeat packet fails to be sent based on all online device identifications and all device identifications recorded in the database;
[0204] The first reminder module is configured to send reminder information to the terminal devices associated with the portable devices corresponding to each disconnected device identifier.
[0205] In some embodiments, the log file obtaining device may further include:
[0206] The first log integration module is configured to: based on the time information in the device log file, obtain the working IP address corresponding to the time information from a pre-stored database; the database stores the mapping relationship between the device identifier and the IP address, the IP address and the time information, and the workstation identifier and the IP address; based on the working IP address, obtain the corresponding workstation log file, and associate the log content of the corresponding time information in the workstation log file with the log content of the corresponding time information in the device log file and store them.
[0207] As an alternative to the above embodiment, in some other embodiments, the log acquisition module may further include:
[0208] The first log integration module is configured to: obtain the workstation log file and workstation identification of the workstation; obtain the corresponding workstation IP address from a pre-stored database based on the workstation identification, and obtain the working device identification corresponding to the workstation IP address at the time information from the database based on the time information in the workstation log file; the database stores the mapping relationship between the device identification and the IP address, the IP address and the time information, and the workstation identification and the IP address; obtain the working device log file of the corresponding mobile device based on the working device identification, and associate and store the log content of the corresponding time information in the working device log file with the log content of the corresponding time information in the workstation log file.
[0209] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0210] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units.
[0211] Corresponding to the above-mentioned embodiment of the log file acquisition method applied to the transfer device, the present application also provides a log file acquisition device, which is applied to the transfer device, and the transfer device is used to establish communication between the server and the mobile device; the device includes:
[0212] The second address acquisition module is configured to: acquire the IP address corresponding to the target device identifier of the target mobile device based on a pre-stored local mapping relationship; the local mapping relationship is stored in the transfer device;
[0213] The second identification acquisition module is configured to: acquire the actual device identification of the mobile device accessed through the IP address;
[0214] The second log acquisition module is configured to: when the target device identifier and the actual device identifier are the same, obtain the device log file of the target portable device; when the target device identifier and the actual device identifier are different, send an IP query request of the target portable device to the server; the server stores a real-time mapping relationship between portable devices and IP addresses; and when receiving the target IP address fed back by the server based on the IP query request, obtain the device log file of the target portable device through the target IP address.
[0215] In some embodiments, the second log acquisition module is further configured to: before acquiring the device log file of the target portable device through the target IP address, acquire the actual device identifier of the portable device accessed through the target IP address; and when the target device identifier and the actual device identifier of the portable device accessed through the target IP address are the same, execute the step of acquiring the device log file of the target portable device through the target IP address.
[0216] In some embodiments, the log file obtaining device may further include:
[0217] The second updating module is configured to: simultaneously or after acquiring the device log file of the target mobile device through the target IP address, update the IP address corresponding to the target device identifier in the local mapping relationship to the target IP address.
[0218] In some embodiments, the log file obtaining device may further include:
[0219] The second sending module is configured to: upon receiving the failure information fed back by the server based on the IP query request, determine that the target portable device is in an offline state, and send a reminder message to the terminal device associated with the target portable device.
[0220] In some embodiments, the log file obtaining device may further include:
[0221] The second log integration module is configured as follows: based on the time information in the device log file, obtaining the working IP address corresponding to the time information from the database of the server; the database stores the mapping relationship between the device identifier and the IP address, the IP address and the time information, and the workstation identifier and the IP address; based on the working IP address, obtaining the corresponding workstation log file, and associating and storing the log content of the corresponding time information in the workstation log file with the log content of the corresponding time information in the device log file.
[0222] As an alternative to the previous embodiment, in other embodiments, the second log integration module can be configured as the following alternative: obtaining the workstation log file and workstation identifier of the workstation; obtaining the corresponding workstation IP address from the database of the server based on the workstation identifier, and based on the time information in the workstation log file, obtaining the working device identifier corresponding to the workstation IP address in the time information from the database of the server; the database stores the mapping relationship between the device identifier and the IP address, the IP address and the time information, and the workstation identifier and the IP address; obtaining the working device log file of the corresponding mobile device based on the working device identifier, and associating and storing the log content of the corresponding time information in the working device log file with the log content of the corresponding time information in the workstation log file.
[0223] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the corresponding method, which will not be repeated here.
[0224] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units.
[0225] Corresponding to the above-mentioned embodiment of the log file acquisition method applied to the server, the present application also provides a log file acquisition device, which is applied to the server, and the server communicates with the mobile device through a transfer device; the device includes:
[0226] The receiving module is configured to: upon receiving an IP query request of a target mobile device sent by the transfer device, obtain the target device identifier, initial IP address and actual device identifier contained in the IP query request; wherein the target device identifier represents the device identifier of the target mobile device, the initial IP address represents the IP address corresponding to the target device identifier queried by the transfer device based on its pre-stored local mapping relationship, and the actual device identifier represents the device identifier of the mobile device actually accessed by the transfer device based on the initial IP address;
[0227] A query module is configured to: based on the target device identifier, query the real-time IP address corresponding to the target device identifier from a pre-stored real-time mapping relationship;
[0228] The sending module is configured to: when the real-time IP address is different from the initial IP address, feed back the real-time IP address to the transfer device, and the real-time IP address is used for the transfer device to access the target mobile device to obtain the device log file of the target mobile device.
[0229] In some embodiments, the log file obtaining device may further include:
[0230] The update module is configured to: when the real-time IP address is not recorded in the real-time mapping relationship, or the real-time IP address is the same as the initial IP address, or the target IP address determined based on the real-time IP address cannot access the target mobile device, update the device identifier corresponding to the initial IP address in the real-time mapping relationship to the actual device identifier, and obtain the original IP address corresponding to the actual device identifier from the real-time mapping relationship as the IP address to be updated; obtain the device identifier to be updated of the mobile device accessed through the IP address to be updated through the transfer device, update the device identifier corresponding to the IP address to be updated in the real-time mapping relationship to the device identifier to be updated, and obtain the original IP address corresponding to the device identifier to be updated from the real-time mapping relationship as the next IP address to be updated, and repeat this step until the real-time IP address is obtained.
[0231] In some embodiments, the update module can also be configured to: during the process of updating the real-time mapping relationship, if no portable device is accessed based on the IP address to be updated, update the IP addresses of the remaining device identifiers whose IP addresses have not been updated in the real-time mapping relationship.
[0232] In some embodiments, the update module can also be configured to: access all IP addresses in the real-time mapping relationship according to a set period to obtain the device identification of the portable device connected when each IP address is accessed; and update the real-time mapping relationship according to the device identification and IP address of all portable devices.
[0233] In some embodiments, the update module can also be configured to: update the mapping relationship between the device identifier and the IP address in the pre-stored database according to the updated real-time mapping relationship, and record the update time of the IP address; the database stores the device identifier and IP address, and the IP address and time information.
[0234] In some embodiments, the log file obtaining device may further include:
[0235] The heartbeat packet module is configured to: send the heartbeat packet to all mobile devices at regular intervals through the transfer device, and obtain the sending status information of the heartbeat packet;
[0236] The disconnected device determination module is configured to: determine the disconnected IP address where the heartbeat packet fails to be sent based on the sending status information, and determine the most recent disconnected device identifier from a pre-stored database based on the disconnected IP address; the database stores device identifiers and IP addresses, and IP addresses and time information;
[0237] The reminder module is configured to send reminder information to the terminal device associated with the portable device corresponding to the disconnected device identifier.
[0238] As an alternative to the above embodiment, in some other embodiments, the log file acquisition device may further include:
[0239] The heartbeat packet module is configured to: send the heartbeat packet to all mobile devices at regular intervals through the transfer device, and obtain the sending status information of the heartbeat packet;
[0240] The disconnected device determination module is configured to: determine the online IP address to which the heartbeat packet is successfully sent based on the sending status information, and obtain the online device identification of the mobile device currently connected to each online IP address; determine the disconnected device identification to which the heartbeat packet fails to be sent based on all online device identifications and all device identifications recorded in a pre-stored database; the database stores device identifications and IP addresses, and IP addresses and time information;
[0241] The reminder module is configured to send reminder information to the terminal device associated with the portable device corresponding to each disconnected device identifier.
[0242] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the corresponding method, which will not be repeated here.
[0243] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units.
[0244] Corresponding to the embodiment of the foregoing log file acquisition method, the present application further provides an electronic device, the electronic device comprising:
[0245] processor;
[0246] a memory for storing a computer program executable by the processor;
[0247] Wherein, when the processor executes the program, the steps of the log file acquisition method in any of the aforementioned method embodiments are implemented.
[0248] The embodiments of the log file acquisition device provided in this application can be applied to electronic devices. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of the electronic device in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory and running them. From the hardware level, such as Figure 8 As shown, Figure 8 is a hardware structure diagram of an electronic device where a log file acquisition device is located according to an exemplary embodiment of the present application, except Figure 2 In addition to the processor 710, memory 730, interface 720, and non-volatile memory 740 shown, the electronic device where the log file acquisition device 10 is located in the embodiment may also include other hardware according to the actual function of the electronic device, which will not be described in detail.
[0249] The present application also provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the steps of the log file acquisition method in any of the aforementioned method embodiments are implemented.
[0250] The present application may take the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code. Computer-readable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer-readable storage media include but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
[0251] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A log file acquisition method, characterized in that: The method comprises: Acquire an initial IP address corresponding to a target device identifier of a target mobile device based on a backup mapping relationship; Obtaining an actual device identifier of the portable device accessed through the initial IP address; When the target device identifier and the actual device identifier are the same, obtaining a device log file of the target portable device; When the target device identifier and the actual device identifier are different, the target IP address corresponding to the target device identifier is queried from the real-time mapping relationship, and the device log file of the target mobile device is obtained through the target IP address; wherein, the data immediacy of the real-time mapping relationship is higher than that of the backup mapping relationship.
2. The log file acquisition method according to claim 1, characterized in that: The querying the target IP address corresponding to the target device identifier from the real-time mapping relationship includes: Based on the target device identifier, querying the real-time IP address corresponding to the target device identifier from the real-time mapping relationship; When the real-time IP address is different from the initial IP address, the real-time IP address is determined to be the target IP address.
3. The log file acquisition method according to claim 2, characterized in that: The method further comprises: When the real-time IP address is not recorded in the real-time mapping relationship, or the real-time IP address is the same as the initial IP address, or the target IP address determined based on the real-time IP address cannot access the target mobile device, the device identifier corresponding to the initial IP address in the real-time mapping relationship is updated to the actual device identifier, and the original IP address corresponding to the actual device identifier is obtained from the real-time mapping relationship as the IP address to be updated; Obtain the device identifier to be updated of the mobile device accessed through the IP address to be updated, update the device identifier corresponding to the IP address to be updated in the real-time mapping relationship to the device identifier to be updated, and obtain the original IP address corresponding to the device identifier to be updated from the real-time mapping relationship as the next IP address to be updated, and repeat this step until the real-time IP address corresponding to the target device identifier is obtained.
4. The log file acquisition method according to claim 3, characterized in that: The method further comprises: In the process of updating the real-time mapping relationship, if any portable device is not accessed based on the IP address to be updated, the IP addresses of the remaining device identifiers whose IP addresses have not been updated in the real-time mapping relationship are updated.
5. The log file acquisition method according to claim 1, characterized in that: The method further comprises: Accessing all IP addresses in the real-time mapping relationship according to a set period to obtain the device identification of the portable device connected when each IP address is accessed; The real-time mapping relationship is updated according to the device identifications and IP addresses of all mobile devices.
6. The log file acquisition method according to any one of claims 3 to 5, characterized in that: The method further comprises: The mapping relationship between the device identification and the IP address in the pre-stored database is updated according to the updated real-time mapping relationship, and the update time of the IP address is recorded.
7. The log file acquisition method according to claim 1, characterized in that: While or after obtaining the device log file of the target mobile device through the target IP address, the method further includes: The IP address corresponding to the target device identifier in the backup mapping relationship is updated to the target IP address.
8. The log file acquisition method according to claim 1, characterized in that: Before obtaining the device log file of the target mobile device through the target IP address, the method further includes: Obtaining an actual device identifier of the portable device accessed through the target IP address; Correspondingly, the step of acquiring the device log file of the target portable device through the target IP address is performed when the target device identifier and the actual device identifier of the portable device accessed through the target IP address are the same.
9. The log file acquisition method according to claim 3, characterized in that: The method further comprises: After the real-time mapping relationship is updated, if the target IP address corresponding to the target device identifier is still not found from the real-time mapping relationship, it is determined that the target mobile device is offline, and a reminder message is sent to the terminal device associated with the target mobile device.
10. The log file acquisition method according to claim 1, characterized in that: The method further comprises: Send heartbeat packets to all mobile devices regularly and obtain the sending status information of the heartbeat packets; Determine the disconnected IP address where the heartbeat packet fails to be sent based on the sending status information, and determine the most recent disconnected device identifier from a pre-stored database based on the disconnected IP address; the database stores a mapping relationship between the device identifier and the IP address, and the IP address and time information; Sending a reminder message to a terminal device associated with the portable device corresponding to the disconnected device identifier.
11. The log file acquisition method according to claim 1, characterized in that: The method further comprises: Send heartbeat packets to all mobile devices regularly and obtain the sending status information of the heartbeat packets; Determine the online IP addresses to which the heartbeat packets are successfully sent based on the sending status information, and obtain the online device identifier of the portable device currently connected to each online IP address; Based on all online device identifiers and all device identifiers recorded in the database, determining the disconnected device identifier for which the heartbeat packet fails to be sent; A reminder message is sent to the terminal device associated with the portable device corresponding to each disconnected device identifier.
12. The log file acquisition method according to any one of claims 1 to 5 and 7 to 11, characterized in that: After obtaining the device log file, the method further includes: Based on the time information in the device log file, the working IP address corresponding to the time information is obtained from a pre-stored database; the database stores the mapping relationship between the device identifier and the IP address, the IP address and the time information, and the workstation identifier and the IP address; A corresponding workstation log file is obtained based on the working IP address, and the log content of the corresponding time information in the workstation log file is associated with the log content of the corresponding time information in the device log file and stored.
13. The log file acquisition method according to any one of claims 1 to 5 and 7 to 11, characterized in that: The method further comprises: Get the workstation log file and workstation ID of the workstation; Based on the workstation identifier, the corresponding workstation IP address is obtained from a pre-stored database, and based on the time information in the workstation log file, the working device identifier corresponding to the workstation IP address at the time information is obtained from the database; the database stores the mapping relationship between the device identifier and the IP address, the IP address and the time information, and the workstation identifier and the IP address; The working device log file of the corresponding mobile device is obtained based on the working device identification, and the log content of the corresponding time information in the working device log file is associated with the log content of the corresponding time information in the workstation log file and stored.
14. A log file acquisition method, characterized in that: Applied to a transfer device, the transfer device is used to establish communication between a server and a mobile device; the method comprises: Acquire the IP address corresponding to the target device identifier of the target mobile device based on the pre-stored local mapping relationship; the local mapping relationship is stored in the transfer device; Obtaining an actual device identifier of the portable device accessed through the IP address; When the target device identifier and the actual device identifier are the same, obtaining a device log file of the target portable device; When the target device identifier and the actual device identifier are different, an IP query request of the target mobile device is sent to the server; the server stores a real-time mapping relationship between the mobile device and the IP address; When the target IP address fed back by the server based on the IP query request is received, the device log file of the target mobile device is obtained through the target IP address.
15. The log file acquisition method according to claim 14, characterized in that: Before obtaining the device log file of the target mobile device through the target IP address, the method further includes: Obtaining an actual device identifier of the portable device accessed through the target IP address; Correspondingly, the step of acquiring the device log file of the target portable device through the target IP address is performed when the target device identifier and the actual device identifier of the portable device accessed through the target IP address are the same.
16. The log file acquisition method according to claim 14, characterized in that: While or after obtaining the device log file of the target mobile device through the target IP address, the method further includes: The IP address corresponding to the target device identifier in the local mapping relationship is updated to the target IP address.
17. The log file acquisition method according to claim, characterized in that: The method further comprises: When failure information fed back by the server based on the IP query request is received, it is determined that the target portable device is in an offline state, and a reminder message is sent to a terminal device associated with the target portable device.
18. The log file acquisition method according to any one of claims 14 to 17, characterized in that: After obtaining the device log file, the method further includes: Based on the time information in the device log file, the working IP address corresponding to the time information is obtained from the database of the server; the database stores the mapping relationship between the device identification and the IP address, the IP address and the time information, and the workstation identification and the IP address; A corresponding workstation log file is obtained based on the working IP address, and the log content of the corresponding time information in the workstation log file is associated with the log content of the corresponding time information in the device log file and stored.
19. The log file acquisition method according to any one of claims 14 to 17, characterized in that: The method further comprises: Get the workstation log file and workstation ID of the workstation; Based on the workstation identifier, the corresponding workstation IP address is obtained from the database of the server, and based on the time information in the workstation log file, the working device identifier corresponding to the workstation IP address at the time information is obtained from the database of the server; the database stores the mapping relationship between the device identifier and the IP address, the IP address and the time information, and the workstation identifier and the IP address; The working device log file of the corresponding mobile device is obtained based on the working device identification, and the log content of the corresponding time information in the working device log file is associated with the log content of the corresponding time information in the workstation log file and stored.
20. A log file acquisition method, characterized in that: Applied to a server, the server communicates with a mobile device through a transfer device; the method comprises: When receiving an IP query request for a target mobile device sent by the transfer device, the target device identifier, initial IP address and actual device identifier contained in the IP query request are obtained; wherein the target device identifier represents the device identifier of the target mobile device, the initial IP address represents the IP address corresponding to the target device identifier queried by the transfer device based on its pre-stored local mapping relationship, and the actual device identifier represents the device identifier of the mobile device actually accessed by the transfer device based on the initial IP address; Based on the target device identifier, query the real-time IP address corresponding to the target device identifier from the pre-stored real-time mapping relationship; When the real-time IP address is different from the initial IP address, the real-time IP address is fed back to the transfer device, and the real-time IP address is used for the transfer device to access the target mobile device to obtain the device log file of the target mobile device.
21. The log file acquisition method according to claim 20, characterized in that: The method further comprises: When the real-time IP address is not recorded in the real-time mapping relationship, or the real-time IP address is the same as the initial IP address, or the target IP address determined based on the real-time IP address cannot access the target mobile device, the device identifier corresponding to the initial IP address in the real-time mapping relationship is updated to the actual device identifier, and the original IP address corresponding to the actual device identifier is obtained from the real-time mapping relationship as the IP address to be updated; Obtain the device identifier to be updated of the mobile device accessed through the IP address to be updated through the transfer device, update the device identifier corresponding to the IP address to be updated in the real-time mapping relationship to the device identifier to be updated, and obtain the original IP address corresponding to the device identifier to be updated from the real-time mapping relationship as the next IP address to be updated, and repeat this step until the real-time IP address is obtained.
22. The log file acquisition method according to claim 21, characterized in that: The method further comprises: In the process of updating the real-time mapping relationship, if any portable device is not accessed based on the IP address to be updated, the IP addresses of the remaining device identifiers whose IP addresses have not been updated in the real-time mapping relationship are updated.
23. The log file acquisition method according to claim 20, characterized in that: The method further comprises: Accessing all IP addresses in the real-time mapping relationship according to a set period to obtain the device identification of the portable device connected when each IP address is accessed; The real-time mapping relationship is updated according to the device identifications and IP addresses of all mobile devices.
24. The log file acquisition method according to any one of claims 21 to 23, characterized in that: The method further comprises: The mapping relationship between the device identifier and the IP address in the pre-stored database is updated according to the updated real-time mapping relationship, and the update time of the IP address is recorded; the database stores the device identifier and the IP address, and the IP address and time information.
25. The log file acquisition method according to any one of claims 20 to 23, characterized in that: The method further comprises: Send heartbeat packets to all mobile devices regularly through the transfer device, and obtain the sending status information of the heartbeat packets; Determine the disconnected IP address where the heartbeat packet fails to be sent based on the sending status information, and determine the most recent disconnected device identifier from a pre-stored database based on the disconnected IP address; the database stores device identifiers and IP addresses, and IP addresses and time information; Sending a reminder message to a terminal device associated with the portable device corresponding to the disconnected device identifier.
26. The log file acquisition method according to any one of claims 20 to 23, characterized in that: The method further comprises: Send heartbeat packets to all mobile devices regularly through the transfer device, and obtain the sending status information of the heartbeat packets; Determine the online IP addresses to which the heartbeat packets are successfully sent based on the sending status information, and obtain the online device identifier of the portable device currently connected to each online IP address; Based on all online device identifiers and all device identifiers recorded in a pre-stored database, determine the disconnected device identifier that fails to send the heartbeat packet; the database stores the device identifier and IP address, and the IP address and time information; A reminder message is sent to the terminal device associated with the portable device corresponding to each disconnected device identifier.
27. A log file acquisition system, characterized in that: It includes a server, a transfer device connected to the server for communication, and a portable device connected to the transfer device for communication; wherein the transfer device is used to obtain the device log file of the target portable device for which the device log file needs to be obtained through the method described in any one of claims 14 to 19; and the server is used to provide the transfer device with the data required to obtain the device log file according to the method described in any one of claims 20 to 26.
28. A log file acquisition device, characterized in that: include: The first address acquisition module is configured to: acquire an initial IP address corresponding to a target device identifier of a target mobile device based on a backup mapping relationship; A first identification acquisition module is configured to: acquire an actual device identification of the portable device accessed through the initial IP address; The first log acquisition module is configured to: when the target device identifier and the actual device identifier are the same, obtain the device log file of the target mobile device; when the target device identifier and the actual device identifier are different, query the target IP address corresponding to the target device identifier from the real-time mapping relationship, and obtain the device log file of the target mobile device through the target IP address; wherein the data immediacy of the real-time mapping relationship is higher than that of the backup mapping relationship.
29. A log file acquisition device, characterized in that: Applied to a transfer device, the transfer device is used to establish communication between a server and a mobile device; the device comprises: The second address acquisition module is configured to: acquire the IP address corresponding to the target device identifier of the target mobile device based on a pre-stored local mapping relationship; the local mapping relationship is stored in the transfer device; The second identification acquisition module is configured to: acquire the actual device identification of the mobile device accessed through the IP address; The second log acquisition module is configured to: when the target device identifier and the actual device identifier are the same, obtain the device log file of the target portable device; when the target device identifier and the actual device identifier are different, send an IP query request of the target portable device to the server; the server stores a real-time mapping relationship between portable devices and IP addresses; and when receiving the target IP address fed back by the server based on the IP query request, obtain the device log file of the target portable device through the target IP address.
30. A log file acquisition device, characterized in that: Applied to a server, the server communicates with a mobile device through a transfer device; the device comprises: The receiving module is configured to: upon receiving an IP query request of a target mobile device sent by the transfer device, obtain the target device identifier, initial IP address and actual device identifier contained in the IP query request; wherein the target device identifier represents the device identifier of the target mobile device, the initial IP address represents the IP address corresponding to the target device identifier queried by the transfer device based on its pre-stored local mapping relationship, and the actual device identifier represents the device identifier of the mobile device actually accessed by the transfer device based on the initial IP address; A query module is configured to: based on the target device identifier, query the real-time IP address corresponding to the target device identifier from a pre-stored real-time mapping relationship; The sending module is configured to: when the real-time IP address is different from the initial IP address, feed back the real-time IP address to the transfer device, and the real-time IP address is used for the transfer device to access the target mobile device to obtain the device log file of the target mobile device.
31. An electronic device, characterized in that: include: processor; a memory for storing a computer program executable by the processor; Wherein, when the processor executes the program, the steps of the method described in any one of claims 1 to 13, and / or 14 to 19, and / or 20 to 26 are implemented.
32. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 13, and / or 14 to 19, and / or 20 to 26 are implemented.