A method, device and medium for extracting business data
By storing and matching the characteristic values of log records in the log cache, business data that operators can understand is extracted, which solves the problem of data extraction difficulties caused by different log records types of different modules, and realizes efficient log data reading and business data extraction.
Patent Information
- Application Number
- CN202210368021.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-08
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2042-04-08
AI Technical Summary
The prior art is difficult to extract business data that operators can understand from irregular logging, especially in different modules with different logging types.
By reading the text information in the vehicle information management text file, we judge whether the log cache is empty, and store the text information in the log cache. The corresponding log type is matched according to the log record characteristic value in the log cache, and business data is extracted from the log record.
It realizes the extraction of business data from different types of log records in different modules, solves the problem of data extraction difficulties caused by different log records types, and reads log data efficiently by reading text information one by one.
Smart Images

Figure CN114741364B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device and medium for extracting business data. Background Art
[0002] As the company's business grows, the required systems are becoming more and more numerous and complex. A complete business process requires the cooperation of multiple modules to complete, and each module will output its own log records when processing business. This makes the log records more scattered, with a variety of formats, and there is no way to make good use of them. For example, when counting vehicle information in the garage, it is necessary to obtain the vehicle's entry and exit time, model, license plate and other information from the log records of each module, but in different modules, the vehicle's entry and exit time, model, license plate and other information are recorded in different ways. When performing statistics, the log records need to be converted into data that the operator can intuitively understand.
[0003] It can be seen that how to extract business data that can be understood by operators from irregular log records is an urgent problem to be solved by technical personnel in this field. Summary of the invention
[0004] The purpose of the present application is to provide a method, device and medium for extracting business data, so as to extract business data that can be understood by operators from irregular log records.
[0005] In order to solve the above technical problems, the present application provides a method for extracting business data, the method comprising:
[0006] Read a text message in the vehicle information management text file;
[0007] Determine whether the log cache is empty;
[0008] If it is empty, the text information is stored in the log cache, and the step of reading a piece of text information in the vehicle information management text file is returned to until all the text information in the vehicle information management text file is read;
[0009] Matching a corresponding log type according to a characteristic value of a log record currently in the log cache and extracting business data from the log record according to the log type;
[0010] If it is not empty, determine whether the text information contains the beginning part information of other log records; if not, store the text information in the log cache, and return to the step of reading a text information in the vehicle information management text file, until the reading of all text information in the vehicle information management text file is completed, and enter the step of matching the corresponding log type according to the feature value of the log record in the current log cache and extracting business data from the log record according to the log type;
[0011] If included, the process proceeds to the step of matching the corresponding log type according to the feature value of the log record currently in the log cache and extracting the business data from the log record according to the log type.
[0012] Preferably, before the step of determining whether the log cache is empty, the method further includes:
[0013] Determining whether the text information is a log record;
[0014] If so, the process proceeds to the step of determining whether the log cache is empty; if not, the process returns to the step of reading a text message in the vehicle information management text file.
[0015] Preferably, after the step of extracting the business data from the log record according to the log type, the method further includes:
[0016] Clear the log records in the log buffer.
[0017] Preferably, extracting business data from the log record according to the log type includes:
[0018] Calling a corresponding matching expression according to the log type, so as to extract original data through the log record;
[0019] The original data is converted into business data according to the corresponding relationship between the original data and the business data.
[0020] Preferably, the method further includes: sending the business data to a storage device for storage.
[0021] Preferably, the business data includes one or more of: license plate number, license plate location, vehicle entry and exit time, vehicle color, and vehicle style.
[0022] Preferably, it also includes:
[0023] The business data is sent to a preset template for storage.
[0024] In order to solve the above technical problems, the present application also provides a device for extracting business data, the device comprising:
[0025] A reading module, used to read a text message in a vehicle information management text file;
[0026] A judgment module is used to judge whether the log cache is empty;
[0027] A processing module, for storing the text information into the log cache if it is empty, and returning to the step of reading a piece of text information in the vehicle information management text file until all the text information in the vehicle information management text file is read;
[0028] Matching a corresponding log type according to a characteristic value of a log record currently in the log cache and extracting business data from the log record according to the log type;
[0029] If it is not empty, determine whether the text information contains the beginning part information of other log records; if not, store the text information in the log cache, and return to the step of reading a text information in the vehicle information management text file, until the reading of all text information in the vehicle information management text file is completed, and enter the step of matching the corresponding log type according to the feature value of the log record in the current log cache and extracting business data from the log record according to the log type;
[0030] If included, the process proceeds to the step of matching the corresponding log type according to the feature value of the log record currently in the log cache and extracting the business data from the log record according to the log type.
[0031] In order to solve the above technical problems, the present application also provides another device for extracting business data, the device comprising a memory for storing a computer program;
[0032] A processor is used to implement the steps of the method for extracting business data as described above when executing the computer program.
[0033] In order to solve the above technical problems, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for extracting business data as described above are implemented.
[0034] The method for extracting business data provided by the present application is to read a text message in a vehicle information management text file in sequence, store the text message of the same log record in a log cache, match the corresponding log type according to the characteristic value of the log record in the log cache, and extract business data from the log record according to the log type. Compared with the current technology, the business data cannot be extracted due to the different types of log records in different modules. By adopting the present technical solution, the business data is extracted according to the log type corresponding to the log record, and different types of log records in different modules can be extracted. In addition, by reading the text information one by one, a small part of the log data is read from the log file each time, which solves the problem of how to read the log efficiently without affecting the business processing.
[0035] In addition, the device and medium for extracting business data provided in the present application correspond to the above-mentioned method for extracting business data, and the effects are the same as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0037] Figure 1 A flowchart of a method for extracting business data provided in an embodiment of the present application;
[0038] Figure 2 A structural diagram of a device for extracting business data provided in an embodiment of the present application;
[0039] Figure 3 A structural diagram of another device for extracting business data provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0041] The core of this application is to provide a method, device and medium for extracting business data, so as to extract business data that can be understood by operators from irregular log records.
[0042] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0043] Figure 1 A flowchart of a method for extracting business data provided by an embodiment of the present application, such as Figure 1 As shown, the method includes:
[0044] S10: Read a text message in the vehicle information management text file.
[0045] In step S10, the vehicle information management text file contains multiple log records, and each log record also has multiple pieces of information. In this application, only one piece of text information is read each time, and the reading of the text information is sequential reading, that is, a text information is read for the first time, and the next text information of the text information is read for the second time.
[0046] S11: Determine whether the log buffer is empty, if it is empty, proceed to step S12, if not empty, proceed to step S14.
[0047] S12: Store the text information into the log buffer.
[0048] S13: Determine whether the reading of all text information in the vehicle information management text file is completed. If not, return to step S10. If so, go to step S15.
[0049] S14: Determine whether the text information contains the beginning part information of other log records. If not, proceed to step S12; if yes, proceed to step S15.
[0050] S15: Match the corresponding log type according to the feature value of the log record in the current log cache and extract the business data from the log record according to the log type.
[0051] In the present embodiment, the log buffer is a buffer space created in advance, which is used to buffer log records. After reading a text message, it is first determined whether the log buffer is empty. If it is empty, the text message is stored in the log buffer for subsequent operations. If the log buffer is not empty and text messages are already stored therein, it is necessary to determine whether the text message read this time contains the beginning part information of other log records. If it does, it means that the text message belongs to the next log record. Therefore, this text message is not stored in the log buffer. At this time, the text message in the log buffer is the entire information of a log record, and step S15 is entered to match the corresponding log type according to the characteristic value of the log record in the current log buffer and extract business data from the log record according to the log type.
[0052] If it does not contain, it means that the text information and the text information already stored in the log cache belong to the same log record, so the text information is stored in the log cache.
[0053] After the text information read this time is stored in the log cache, it is necessary to return to step S10 to continue reading the next text information. If the text information just stored is the last text information in the vehicle information management text file, step S10 can no longer read the text information. Therefore, after storing the text information in the log cache, it is also necessary to determine whether the reading of all the text information in the vehicle information management text file has been completed. If not, it can return to step S10 to read the next text information. If it is completed, it means that the text information in the log cache is already all the information of the log record. Similarly, step S15 is entered to match the corresponding log type according to the characteristic value of the log record in the current log cache and extract business data from the log record according to the log type.
[0054] In step S15, it is understood that the text information of the same log record should be generated by the same data processing method. Therefore, according to the characteristic value of the log record stored in the current log cache, the translation method of the log record corresponding to the characteristic value, that is, the log type, is found, and the business data that is easy for personnel to understand is extracted from the log record through the corresponding processing method. In a specific implementation, the business data can be information such as vehicle entry and exit time and license plate number.
[0055] The method for extracting business data provided by the embodiment of the present application is to read a text message in the vehicle information management text file in sequence, store the text message of the same log record in the log cache, match the corresponding log type according to the characteristic value of the log record in the log cache, and extract the business data from the log record according to the log type. Compared with the current technology, the business data cannot be extracted due to the different types of log records in different modules. By adopting the technical solution, the business data is extracted according to the log type corresponding to the log record, and different types of log records in different modules can be extracted. In addition, by reading the text information one by one, a small part of the log data is read from the log file each time, which solves the problem of how to read the log efficiently without affecting the business processing.
[0056] It is understandable that the vehicle information management text file contains not only a variety of log records, but also other text information to ensure the execution of the program. When caching log records, other text information is not needed. Therefore, in this embodiment, before the step of determining whether the log cache is empty, it also includes:
[0057] Determine whether the text information is a log record;
[0058] If so, the process proceeds to the step of determining whether the log buffer is empty; if not, the process returns to the step of reading a text message in the vehicle information management text file.
[0059] The method for extracting business data provided in the embodiment of the present application determines whether a text message is a log record after obtaining the text message, so as to exclude text information that does not belong to the log record and avoid wasting cache space and data processing efficiency.
[0060] Based on the above embodiment, in this embodiment, after the step of extracting business data from the log record according to the log type, the following steps are also included:
[0061] Clears the log records in the log buffer.
[0062] After extracting business data from the log record in the current log cache, this embodiment clears the log cache to facilitate the entry of the next log record.
[0063] Based on the above embodiment, this embodiment provides a specific method for extracting business data from log records according to log types, the method comprising:
[0064] Call the corresponding matching expression according to the log type to extract the original data from the log record;
[0065] According to the correspondence between the original data and the business data, the original data is converted into business data.
[0066] In the above embodiment, the scene corresponding to the log record is first located by the feature value to determine the log type. In the present embodiment, it is necessary to call the corresponding matching expression according to the log type to extract the original data from the log record. The original data is usually a string. The string is mapped to a structured variable with a specific meaning according to the position of the string. That is, the original data is converted into business data according to the correspondence between the original data and the business data.
[0067] This embodiment provides a specific method for extracting business data from log records according to log types. This method can be used to extract character strings from text information in log records, and then convert the character strings into structured business data so that technical personnel can understand them.
[0068] After the business data is extracted, in order to facilitate the subsequent statistics and tracing of vehicle information by technical personnel, the method for extracting business data provided in this embodiment also includes: sending the business data to a storage device for storage.
[0069] In a specific implementation, the business data reflects the information recorded when the vehicle enters and exits the parking lot, which may record some of the vehicle's iconic features or all of the features.
[0070] In this embodiment, the business data includes one or more of: license plate number, license plate location, vehicle entry and exit time, vehicle color, and vehicle style.
[0071] It is understandable that due to the multi-module processing method, the log records generated by different modules may contain only a single feature of the vehicle, or multiple features. Therefore, if the types of business data are too few, it is impossible to extract all the features of the vehicle, which is not conducive to management. This embodiment provides extraction content of multiple vehicle features to enrich the management and control methods of vehicle information.
[0072] Based on the above embodiment, in this embodiment, it further includes:
[0073] Send business data to the preset template for saving.
[0074] This embodiment sends the extracted business data to a preset template for storage, so as to facilitate unified management and viewing of different business data.
[0075] In the above embodiments, the method for extracting business data is described in detail, and the present application also provides an embodiment corresponding to the device for extracting business data. It should be noted that the present application describes the embodiments of the device part from two perspectives, one is based on the perspective of functional modules, and the other is based on the perspective of hardware.
[0076] Figure 2 A structural diagram of a device for extracting business data provided in an embodiment of the present application, such as Figure 2 As shown, the device comprises:
[0077] The reading module 10 is used to read a piece of text information in the vehicle information management text file.
[0078] The judging module 11 is used to judge whether the log buffer is empty.
[0079] The processing module 12 is used to store the text information in the log cache if it is empty, and return to the step of reading a text information in the vehicle information management text file until the reading of all the text information in the vehicle information management text file is completed;
[0080] Match the corresponding log type according to the feature value of the log record in the current log cache and extract business data from the log record according to the log type;
[0081] If it is not empty, determine whether the text information contains the beginning part of other log records. If not, store the text information in the log cache and return to the step of reading a text information in the vehicle information management text file until all the text information in the vehicle information management text file is read, and enter the step of matching the corresponding log type according to the feature value of the log record in the current log cache and extracting business data from the log record according to the log type;
[0082] If included, the process proceeds to the step of matching the corresponding log type according to the feature value of the log record in the current log cache and extracting the business data from the log record according to the log type.
[0083] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.
[0084] The device for extracting business data provided by the embodiment of the present application reads a text message in the vehicle information management text file in sequence, stores the text message of the same log record in the log cache, matches the corresponding log type according to the characteristic value of the log record in the log cache, and extracts the business data from the log record according to the log type. Compared with the current technology, the business data cannot be extracted due to the different types of log records in different modules. By adopting the technical solution, the business data is extracted according to the log type corresponding to the log record, and different types of log records in different modules can be extracted. In addition, by reading the text information one by one, a small part of the log data is read from the log file each time, which solves the problem of how to read the log efficiently without affecting the business processing.
[0085] Figure 3 A structural diagram of another device for business data provided in an embodiment of the present application, such as Figure 3 As shown, the device comprises: a memory 20 for storing a computer program;
[0086] The processor 21 is used to implement the steps of the method for processing business data in the above embodiment when executing a computer program.
[0087] The device for storing the business data provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a laptop computer, or a desktop computer.
[0088] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0089] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, the relevant steps of the method for business data disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. Data 203 may include but is not limited to text information, business data, etc.
[0090] In some embodiments, the device for business data may also include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .
[0091] Those skilled in the art will understand that Figure 3 The structure shown in the figure does not constitute a limitation on the device for business data, and may include more or fewer components than those shown in the figure.
[0092] The device for storing business data provided by the embodiment of the present application includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: read a text message in a vehicle information management text file; determine whether the log cache is empty; if it is empty, store the text message in the log cache, and return to the step of reading a text message in the vehicle information management text file until all the text information in the vehicle information management text file is read; match the corresponding log type according to the characteristic value of the log record in the current log cache and extract business data from the log record according to the log type; if it is not empty, determine whether the text message contains the starting part information of other log records, if not, store the text message in the log cache, and return to the step of reading a text message in the vehicle information management text file until all the text information in the vehicle information management text file is read, and enter the step of matching the corresponding log type according to the characteristic value of the log record in the current log cache and extracting business data from the log record according to the log type; if it is contained, enter the step of matching the corresponding log type according to the characteristic value of the log record in the current log cache and extracting business data from the log record according to the log type.
[0093] The device for extracting business data provided by the embodiment of the present application reads a text message in the vehicle information management text file in sequence, stores the text message of the same log record in the log cache, matches the corresponding log type according to the characteristic value of the log record in the log cache, and extracts the business data from the log record according to the log type. Compared with the current technology, the business data cannot be extracted due to the different types of log records in different modules. By adopting the technical solution, the business data is extracted according to the log type corresponding to the log record, and different types of log records in different modules can be extracted. In addition, by reading the text information one by one, a small part of the log data is read from the log file each time, which solves the problem of how to read the log efficiently without affecting the business processing.
[0094] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.
[0095] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0096] The computer-readable storage medium provided by the embodiment of the present application sequentially reads a text message in a vehicle information management text file, stores the text message of the same log record in a log cache, matches the corresponding log type according to the characteristic value of the log record in the log cache, and extracts business data from the log record according to the log type. Compared with the current technology, the business data cannot be extracted due to the different types of log records in different modules. By adopting the technical solution, the business data is extracted according to the log type corresponding to the log record, and different types of log records in different modules can be extracted. In addition, by reading the text information one by one, a small part of the log data is read from the log file each time, which solves the problem of how to read the log efficiently without affecting the business processing.
[0097] The above is a detailed introduction to the method, device and medium for extracting business data provided by the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
[0098] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A method for extracting business data, characterized in that: include: Reading a text message in a vehicle information management text file; the vehicle information management text file contains a plurality of log records, and each log record also has a plurality of text messages; Determine whether the log cache is empty; If it is empty, the text information is stored in the log cache, and the step of reading a piece of text information in the vehicle information management text file is returned to until all the text information in the vehicle information management text file is read; Matching a corresponding log type according to a characteristic value of a log record currently in the log cache and extracting business data from the log record according to the log type; If it is not empty, determine whether the text information contains the beginning part information of other log records; if not, the text information and the text information already stored in the log cache belong to the same log record, then store the text information in the log cache, and return to the step of reading a text information in the vehicle information management text file, until the reading of all text information in the vehicle information management text file is completed, and enter the step of matching the corresponding log type according to the feature value of the log record in the current log cache and extracting business data from the log record according to the log type; If included, the text information belongs to the next log record, and the process proceeds to the step of matching the corresponding log type according to the feature value of the log record currently in the log cache and extracting business data from the log record according to the log type.
2. The method for extracting business data according to claim 1, characterized in that: Before the step of determining whether the log cache is empty, the method further includes: Determining whether the text information is a log record; If so, the process proceeds to the step of determining whether the log cache is empty; if not, the process returns to the step of reading a text message in the vehicle information management text file.
3. The method for extracting business data according to claim 2, characterized in that: After the step of extracting the business data from the log record according to the log type, the method further includes: Clear the log records in the log buffer.
4. The method for extracting business data according to claim 1, characterized in that: The extracting the business data from the log record according to the log type comprises: Calling a corresponding matching expression according to the log type, so as to extract original data through the log record; The original data is converted into business data according to the corresponding relationship between the original data and the business data.
5. The method for extracting business data according to claim 4, characterized in that: Also includes: The business data is sent to a storage device for storage.
6. The method for extracting business data according to claim 1, characterized in that: The business data includes: one or more of: license plate number, license plate location, vehicle entry and exit time, vehicle color, and vehicle style.
7. The method for extracting business data according to claim 6, characterized in that: Also includes: The business data is sent to a preset template for storage.
8. A device for extracting business data, characterized in that: include: A reading module, used for reading a piece of text information in a vehicle information management text file; the vehicle information management text file contains a plurality of log records, and each log record also has a plurality of the text information; A judgment module is used to judge whether the log cache is empty; A processing module, for storing the text information into the log cache if it is empty, and returning to the step of reading a piece of text information in the vehicle information management text file until all the text information in the vehicle information management text file is read; Matching a corresponding log type according to a characteristic value of a log record currently in the log cache and extracting business data from the log record according to the log type; If it is not empty, determine whether the text information contains the beginning part information of other log records; if not, the text information and the text information already stored in the log cache belong to the same log record, then store the text information in the log cache, and return to the step of reading a text information in the vehicle information management text file, until the reading of all text information in the vehicle information management text file is completed, and enter the step of matching the corresponding log type according to the feature value of the log record in the current log cache and extracting business data from the log record according to the log type; If included, the text information belongs to the next log record, and the process proceeds to the step of matching the corresponding log type according to the feature value of the log record currently in the log cache and extracting business data from the log record according to the log type.
9. A device for extracting business data, characterized in that: comprising a memory for storing a computer program; A processor, configured to implement the steps of the method for extracting business data as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for extracting business data according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
System and method for remotely collecting, retrieving and displaying application system logs
CN103914485A
Underground high-speed real-time compression method for density logger while drilling based on hash dictionary
CN108494408A