CN110716946A - Method and device for updating feature rule matching library, storage medium and electronic equipment - Google Patents

Method and device for updating feature rule matching library, storage medium and electronic equipment Download PDF

Info

Publication number
CN110716946A
CN110716946A CN201911007578.9A CN201911007578A CN110716946A CN 110716946 A CN110716946 A CN 110716946A CN 201911007578 A CN201911007578 A CN 201911007578A CN 110716946 A CN110716946 A CN 110716946A
Authority
CN
China
Prior art keywords
library
sub
feature rule
feature
target sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911007578.9A
Other languages
Chinese (zh)
Other versions
CN110716946B (en
Inventor
田慧萌
谢永恒
樊景亮
龙大鹏
冯建业
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Ruian Technology Co Ltd
Original Assignee
Beijing Ruian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Ruian Technology Co Ltd filed Critical Beijing Ruian Technology Co Ltd
Priority to CN201911007578.9A priority Critical patent/CN110716946B/en
Publication of CN110716946A publication Critical patent/CN110716946A/en
Application granted granted Critical
Publication of CN110716946B publication Critical patent/CN110716946B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Abstract

The invention discloses a method, a device, a storage medium and electronic equipment for updating a feature rule matching library, wherein the method comprises the steps of receiving a feature rule processing instruction, wherein the feature rule processing instruction comprises a feature rule processing type and feature rule information; determining a target sub-library according to the feature rule processing instruction, and updating the target sub-library based on the feature rule processing type and the feature rule information; determining a target sub-library updated in a preset time interval according to the preset time interval; compiling the updated target sub-library, and updating the feature rule matching library according to the feature rule matching sub-library obtained by compiling. The space for storing the feature rules is divided into the plurality of independent sub-libraries, so that the sub-libraries have small capacity and high compiling speed, and the sub-libraries are independent from each other and can be compiled in parallel, thereby reducing the compiling time, improving the compiling efficiency of the feature rule matching library and improving the compiling real-time performance of the feature rule matching library.

Description

Method and device for updating feature rule matching library, storage medium and electronic equipment
Technical Field
The embodiment of the invention relates to the technical field of data communication, in particular to a method and a device for updating a feature rule matching library, a storage medium and electronic equipment.
Background
Hyperscan is a high performance regular expression matching library from Intel. The use process of the Hyperscan library is as follows: firstly, calling a compiler to compile the characteristic rules to generate a corresponding database, and storing the generated database after serialization in a memory for extracting and using in a running period; and secondly, calling a matching engine inside the Hyperscan to perform pattern matching based on the database generated by compiling. Referring to fig. 1, fig. 1 is a schematic diagram of compilation of a Hyperscan library in the prior art.
Because the feature rule needs to be compiled in advance to perform feature matching in the using process of the hyperscan library, the whole feature library needs to be recompiled even if a small amount of features change, the time required by the compiling step is multiplied along with the increase of the feature scale, and when the feature library reaches the million level, the compiling time is long, so that the real-time performance of the feature rule can not be ensured.
Disclosure of Invention
The invention provides a method and a device for updating a feature rule matching library, a storage medium and electronic equipment, which are used for improving the real-time property of updating the feature rule matching library.
In a first aspect, an embodiment of the present invention provides a method for updating a feature rule matching library, where an electronic device includes multiple independent sub-libraries with preset capacities, and the sub-libraries are used to store information of feature rules;
wherein the method comprises the following steps:
receiving a feature rule processing instruction, wherein the feature rule processing instruction comprises a feature rule processing type and feature rule information;
determining a target sub-library according to the feature rule processing instruction, and updating the target sub-library based on the feature rule processing type and the feature rule information;
determining a target sub-library updated in a preset time interval according to the preset time interval;
compiling the updated target sub-library, and updating the feature rule matching library according to the feature rule matching sub-library obtained by compiling.
In a second aspect, an embodiment of the present invention further provides an updating apparatus for a feature rule matching library, where the apparatus includes a plurality of independent sub-libraries with preset capacity, and the sub-libraries are used to store information of feature rules;
wherein the apparatus comprises:
the processing instruction receiving module is used for receiving a feature rule processing instruction, wherein the feature rule processing instruction comprises a feature rule processing type and feature rule information;
the target sub-library updating module is used for determining a target sub-library according to the characteristic rule processing instruction and updating the target sub-library based on the characteristic rule processing type and the characteristic rule information;
the updating sub-library determining module is used for determining a target sub-library which is updated within a preset time interval according to the preset time interval;
and the feature rule matching library updating module is used for compiling the updated target sub-library and updating the feature rule matching library according to the feature rule matching sub-library obtained by compiling.
In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the method for updating the feature rule matching library according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for updating the feature rule matching base according to any embodiment of the present invention.
According to the technical scheme provided by the embodiment of the invention, the space for storing the feature rules is divided into a plurality of independent sub-libraries, the target sub-library is updated according to the feature rule processing instruction, and only the updated target sub-library is compiled, so that the feature rule matching library is updated. Meanwhile, the updated target sub-libraries are compiled based on the preset time interval, so that frequent updating of each sub-library in the characteristic rule processing process is prevented.
Drawings
FIG. 1 is a compilation diagram of a Hyperscan library in the prior art;
FIG. 2 is a schematic diagram of a deployment control system provided by an embodiment of the present invention;
fig. 3 is a schematic flowchart of a method for updating a feature rule matching base according to an embodiment of the present invention;
FIG. 4 is a compilation diagram of a Hyperscan library according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus for updating a feature rule matching library according to a second embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
The method for updating the feature rule matching library provided in the embodiment of the present application can be applied to a deployment and control system, for example, refer to fig. 2, and fig. 2 is a schematic diagram of the deployment and control system provided in the embodiment of the present invention. Fig. 2 includes a packet sending apparatus 10, a rule issuing apparatus 20, and a feature matching apparatus 30, where the packet sending apparatus 10 may be a computer or a server, and is configured to send a network data packet to the feature matching system 30, the feature matching system 30 includes a feature rule matching library, the rule issuing apparatus 20 issues a feature rule to the feature matching system 30, for example, the data packet may include multiple mobile phone numbers, the feature rule issued by the rule issuing apparatus 20 to the feature matching system 30 may be a mobile phone number rule, the feature matching system 30 compiles a received mobile phone number rule, updates the feature rule matching library, and matches data in the network data packet based on the updated feature rule matching library to obtain network data traffic hitting a mobile phone number, that is, feature traffic, or generates a feature log based on the hitting mobile phone number.
Example one
Fig. 3 is a schematic flow chart of a method for updating a feature rule matching library according to an embodiment of the present invention, where the embodiment is applicable to a situation of updating a feature rule matching library, and the method may be executed by an updating apparatus of a feature rule matching library according to an embodiment of the present invention, and the apparatus may be implemented in a software/hardware manner, and may be integrated in an electronic device such as a computer or an electronic device. The method specifically comprises the following steps:
s110, receiving a feature rule processing instruction, wherein the feature rule processing instruction comprises a feature rule processing type and feature rule information.
S120, determining a target sub-library according to the feature rule processing instruction, and updating the target sub-library based on the feature rule processing type and the feature rule information.
S130, determining a target sub-library to be updated in a preset time interval according to the preset time interval.
And S140, compiling the updated target sub-library, and updating the feature rule matching library according to the feature rule matching sub-library obtained by compiling.
In this embodiment, the electronic device includes a plurality of independent sub-libraries with preset capacity, where the sub-libraries are used to store information of the feature rules, and the preset capacity of each sub-library may be a capacity of 3000 feature rules. In this embodiment, the storage space for storing the feature rules is divided into a plurality of independent sub-libraries, each sub-library is used for storing the feature rules, the storage capacity of the sub-libraries is small, fast compilation can be achieved, the sub-libraries are independent from each other, and the sub-libraries can be compiled in parallel, so that the compilation time of the feature rule matching library is reduced, and the compilation instantaneity of the feature rule matching library is improved.
Receiving a feature rule processing instruction issued by the rule issuing device 20, where the feature rule processing instruction includes a feature rule processing type and feature rule information, where the feature rule processing type includes addition and deletion, and the feature rule may be a regular rule. In this embodiment, the processing logic of the feature rule is determined according to the processing type of the feature rule, and the processing logic corresponding to different processing types of the feature rule is different. In this embodiment, the target sub-library is processed according to the feature rule processing instruction and the corresponding processing logic, that is, the feature rule is added to the target sub-library or the corresponding feature rule is deleted from the target sub-library. Correspondingly, because the characteristic rules stored in other sub-libraries are not changed, when the characteristic rule matching library is updated, the updated target sub-library can be compiled only, so that the characteristic rule matching library can be updated, all the sub-libraries do not need to be compiled, the compiling process of the characteristic rule matching library is simplified, the compiling efficiency of the characteristic rule matching library is improved, and the compiling real-time performance of the characteristic rule matching library is improved.
When the feature rule processing type is increased, optionally, determining a target sub-library according to the feature rule processing instruction, and updating the target sub-library based on the feature rule processing type and the feature rule information includes: determining currently available sub-libraries, wherein any sub-library in the currently available sub-libraries is determined as a target sub-library; and adding the characteristic string in the characteristic rule information into the target sub-library. And the current available sub-library is a sub-library which has residual capacity and can store the newly added characteristic rules. In this embodiment, any currently available sub-library may be determined as a target sub-library, and a feature string of a feature rule is added to the target sub-library, where when the feature rule is a regular rule, the feature string of the feature rule is a regular expression.
Optionally, an available sub library list is set in the electronic device, where the available sub library list includes identification information of a currently available sub library, and accordingly, determining the currently available sub library includes: reading the identification information of the currently available sub-library from the list of available sub-libraries, and determining the currently available sub-library based on the identification information of the currently available sub-library, wherein the identification information of the available sub-library may be the number of the sub-library. After receiving the characteristic rule processing instruction, when the characteristic rule processing type is increased, reading the identification information of the current available sub-library from the available sub-library list, when the identification information can be read, determining a target sub-library according to the read identification information, when the read identification information is empty, determining that the current available sub-library does not exist, creating a new sub-library, determining the newly-built sub-library as the target sub-library, and correspondingly, adding the identification information of the newly-built sub-library into the available sub-library list.
Optionally, after the feature string in the feature rule information is added to the target sub library, determining a remaining capacity of the target sub library, when the remaining capacity of the target sub library is 0, determining that the target sub library is full, removing the identification information of the target sub library from the available sub library list, when the remaining capacity of the target sub library is greater than 0, indicating that the target sub library is still the available sub library, maintaining the available sub library list, and not processing the available sub library list.
It should be noted that, because the feature rule information includes not only the feature string, in order to ensure that other information of the feature is not lost, a rule array is set in the electronic device, and the rule number is used for storing structured feature rule data. Optionally, after receiving the feature rule processing instruction, when the feature rule processing type is increased, the rule array is searched by using the feature rule ID of the feature rule information as an index. When the rule array has the feature rule identical to the feature rule ID, error prompt information is generated, when the rule array does not have the feature rule identical to the feature rule ID, a structured feature object is generated according to the feature rule information, and the feature object is stored in the corresponding position of the feature rule ID in the rule array. Accordingly, after the currently available sub-library is determined, the feature string in the feature rule information is added to the target sub-library.
When the feature rule processing type is deletion, optionally, determining a target sub-library according to the feature rule processing instruction, and updating the target sub-library based on the feature rule processing type and the feature rule information includes: inquiring in each sub-library based on the identification information in the characteristic rule information, and determining the sub-library in which the characteristic rule information to be deleted is positioned as a target sub-library; and deleting the characteristic string in the characteristic rule information in the target sub-library. In each sub-library, the stored feature string of the feature rule carries identification information (for example, the feature rule ID), and matching can be performed according to the identification information to determine a target sub-library where the feature rule information to be deleted is located. The mapping relationship between the feature rule identifier and the sub-library may also be set, and the sub-library corresponding to the feature rule identifier, that is, the target sub-library for storing the feature rule information to be deleted, may be determined based on the mapping relationship. And deleting the feature string in the feature rule processing instruction from the target sub-library, and correspondingly, removing the mapping between the feature rule identification of the feature string and the sub-library from the mapping relation.
It should be noted that, with the feature rule ID of the feature rule information as an index, a rule array is searched, a corresponding feature object is deleted from the feature array, and the position of the feature rule ID in the index is set to be null.
On the basis of the embodiment, the target sub-library to be updated is determined according to the preset time interval, and the target sub-library to be updated in the preset time interval is input into the rule compiler for compiling. Exemplarily, referring to fig. 4, fig. 4 is a compilation schematic diagram of a Hyperscan library provided by an embodiment of the present invention, where an electronic device includes three sub-libraries, a sub-library 1, a sub-library 2, and a sub-library 3, which are used for storing a regular expression, the sub-library 1 and the sub-library 3 are updated at a preset time interval, the sub-library 1 and the sub-library 3 are input to a Hyperscan compiler, a feature rule matching sub-library is obtained through compilation, an original feature rule matching library is updated based on the feature rule matching sub-library to obtain a new feature rule matching library, and compared to fig. 1, when a feature rule is updated, all feature rules are recompiled, so that the number of feature rules to be compiled is reduced, and meanwhile, multiple sub-libraries can be compiled in parallel, so that compiling efficiency and compiling real-time are further provided.
Optionally, an updated sub-library list is set, and after the target sub-library is updated based on the feature rule processing type and the feature rule information, the identification information of the target sub-library is added to the updated sub-library list; correspondingly, the determining the target sub-library updated within the preset time interval includes: and determining an updated target sub-library based on the identification information in the updated sub-library list, namely determining the target sub-library corresponding to the identification information in the updated sub-library list as the updated target sub-library.
Inputting the updated target sub-library into the rule compiler to obtain a new feature rule matching sub-library, and correspondingly updating the feature rule matching library according to the compiled feature rule matching sub-library, wherein the step of updating the feature rule matching library can be that the original feature rule matching sub-library corresponding to the new feature rule matching sub-library in the original feature rule matching library is replaced based on the new feature rule matching sub-library by traversing the original feature rule matching library to obtain the new feature rule matching library. It should be noted that the original feature rule matching library is not an original feature rule matching library in use, but an original feature rule matching library stored in the electronic device.
It should be noted that, in order to avoid frequent compiling of the target sub-library, a preset time interval for performing caching is set, where the preset time interval is of the order of ms, and may be, for example, 1ms or 10ms, the preset time interval may be determined according to the real-time requirement of the feature rule matching library, and the higher the real-time requirement is, the smaller the preset time interval is.
On the basis of the above embodiment, after the updated target sub library is compiled, the updated sub library list is emptied, and the identification information of the updated target sub library in the next preset time interval is added to the empty updated sub library list.
On the basis of the above embodiment, after compiling the updated target sub-library, the method further includes: emptying the available sub-library list; and traversing each sub-library, determining the sub-library with the residual capacity larger than the preset value as a current available sub-library, and generating a new available sub-library list according to the identification information of the current available sub-library. In this embodiment, only the sub-library with the remaining capacity greater than the preset value is determined as the current available sub-library, and therefore, when the sub-library with the smaller remaining capacity is used as the available sub-library, the number of the updated feature rules of the available sub-library is smaller, which correspondingly increases the number of the updated sub-libraries and affects the compiling efficiency.
According to the technical scheme, the space for storing the feature rules is divided into the plurality of independent sub-libraries, the target sub-library is updated according to the feature rule processing instructions, and only the updated target sub-library is compiled, so that the feature rule matching library is updated, the sub-libraries are small in capacity and high in compiling speed, the sub-libraries are independent from one another and can be compiled in parallel, compiling time is shortened, compiling efficiency of the feature rule matching library is improved, and compiling real-time performance of the feature rule matching library is improved. Meanwhile, the updated target sub-libraries are compiled based on the preset time interval, so that frequent updating of each sub-library in the characteristic rule processing process is prevented.
On the basis of the above embodiment, after updating the feature rule matching library according to the compiled feature rule matching sub-library, the method further includes: acquiring a read lock, wherein the read lock is used for refusing access to an original feature rule matching library; replacing the original feature rule matching library based on the updated feature rule matching library; releasing the read lock.
It should be noted that the new feature rule matching library obtained in the above embodiment cannot be used, and through a lock reading operation, access to the original feature rule matching library is denied, and based on the feature rule matching library after being updated calling a feature library matching interface for matching, replacement of the original feature rule matching library is realized, a lock reading is released, and access to the updated feature rule matching library is allowed. In the embodiment, the original characteristic rule matching library is replaced based on the matching interface in the lock reading state, so that the original characteristic rule matching library used in the control system is rapidly updated.
Example two
Fig. 5 is a schematic structural diagram of an updating apparatus for a feature rule matching library according to a second embodiment of the present invention, where the apparatus includes a plurality of independent sub-libraries with preset capacities, and the sub-libraries are used for storing information of feature rules; wherein the apparatus comprises:
a processing instruction receiving module 210, configured to receive a feature rule processing instruction, where the feature rule processing instruction includes a feature rule processing type and feature rule information;
a target sub-library updating module 220, configured to determine a target sub-library according to the feature rule processing instruction, and update the target sub-library based on the feature rule processing type and the feature rule information;
an update sub-library determining module 230, configured to determine, according to a preset time interval, a target sub-library to be updated within the preset time interval;
and a feature rule matching library updating module 240, configured to compile the updated target sub-library, and update the feature rule matching library according to the compiled feature rule matching sub-library.
On the basis of the above embodiment, the feature rule processing type includes addition;
optionally, the target sub-library updating module 220 includes:
a first target sub-library determining unit, configured to determine, when the feature rule processing type is increase, currently available sub-libraries, and determine, as a target sub-library, any one of the currently available sub-libraries;
a second target sub-library determining unit, configured to create a new sub-library if the currently available sub-library is empty, and determine the created sub-library as the target sub-library;
and the first target sub-library updating unit is used for adding the characteristic string in the characteristic rule information into the target sub-library.
Optionally, an available sub-library list is set in the electronic device, where the available sub-library list includes identification information of a currently available sub-library;
optionally, the first target sub-library determining unit is configured to:
and reading the identification information of the currently available sub-library from the available sub-library list, and determining the currently available sub-library based on the identification information of the currently available sub-library.
Optionally, the target sub-library updating module 220 further includes:
a first available sub-library list updating unit, configured to add the feature string in the feature rule information to the target sub-library, and then add the identification information of the newly created sub-library to the available sub-library list; when the target sub-library is full, removing the identification information of the target sub-library from the list of available sub-libraries.
Optionally, the target sub-library updating module 220 further includes:
and the second available sub-library list updating unit is used for emptying the available sub-library list after compiling the updated target sub-library, traversing each sub-library, determining the sub-library with the residual capacity larger than the preset value as the current available sub-library, and generating a new available sub-library list according to the identification information of the current available sub-library.
On the basis of the above embodiment, the feature rule processing type includes deletion;
optionally, the target sub-library updating module 220 includes:
a third target sub-library determining unit, configured to, when the feature rule processing type is deletion, perform query in each sub-library based on identification information in the feature rule information, and determine a sub-library in which the feature rule information to be deleted is located as a target sub-library;
and the second target sub-library updating unit is used for deleting the characteristic strings in the characteristic rule information in the target sub-library.
On the basis of the above embodiment, the apparatus further includes:
an update sub-library list determination module, configured to add, after the target sub-library is updated based on the feature rule processing type and the feature rule information, identification information of the target sub-library to an update sub-library list;
the updated sub-library determining module 230 is configured to determine an updated target sub-library based on the identification information in the updated sub-library list, wherein the updated sub-library list is emptied after the updated target sub-library is compiled.
On the basis of the above embodiment, the apparatus further includes:
the reading lock acquisition module is used for acquiring a reading lock after updating the feature rule matching library according to the feature rule matching sub-library obtained by compiling, wherein the reading lock is used for refusing the access to the original feature rule matching library;
the characteristic rule matching library replacing module is used for replacing the original characteristic rule matching library based on the updated characteristic rule matching library;
and the reading lock releasing module is used for releasing the reading lock.
The updating device of the feature rule matching library provided by any embodiment of the invention can execute the updating method of the feature rule matching library provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the updating method of the feature rule matching library.
EXAMPLE III
Fig. 6 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention. FIG. 6 illustrates a block diagram of an electronic device 412 that is suitable for use in implementing embodiments of the present invention. The electronic device 412 shown in fig. 6 is only an example and should not bring any limitations to the functionality and scope of use of the embodiments of the present invention. The device 412 is typically an electronic device that undertakes image classification functions.
As shown in fig. 6, the electronic device 412 is in the form of a general purpose computing device. The components of the electronic device 412 may include, but are not limited to: one or more processors 416, a storage device 428, and a bus 418 that couples the various system components including the storage device 428 and the processors 416.
Bus 418 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 412 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 412 and includes both volatile and nonvolatile media, removable and non-removable media.
Storage 428 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 430 and/or cache Memory 432. The electronic device 412 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 434 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard drive"). Although not shown in FIG. 6, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk-Read Only Memory (CD-ROM), a Digital Video disk (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 418 by one or more data media interfaces. Storage 428 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
Program 436 having a set (at least one) of program modules 426 may be stored, for example, in storage 428, such program modules 426 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination may comprise an implementation of a network environment. Program modules 426 generally perform the functions and/or methodologies of embodiments of the invention as described herein.
The electronic device 412 may also communicate with one or more external devices 414 (e.g., keyboard, pointing device, camera, display 424, etc.), with one or more devices that enable a user to interact with the electronic device 412, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 412 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 422. Also, the electronic device 412 may communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), and/or a public Network, such as the internet) via the Network adapter 420. As shown, network adapter 420 communicates with the other modules of electronic device 412 over bus 418. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 412, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, disk array (RAID) systems, tape drives, and data backup storage systems, to name a few.
The processor 416 executes various functional applications and data processing by executing programs stored in the storage 428, for example, implementing the updating method of the feature rule matching library provided by the above-described embodiment of the present invention.
Example four
The fourth embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for updating the feature rule matching library according to the fourth embodiment of the present invention.
Of course, the computer program stored on the computer-readable storage medium provided by the embodiment of the present invention is not limited to the method operations described above, and may also perform the method for updating the feature rule matching library provided by any embodiment of the present invention.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable source code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Source code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer source code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The source code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (11)

1. A method for updating a feature rule matching library is characterized in that electronic equipment comprises a plurality of independent sub-libraries with preset capacity, wherein the sub-libraries are used for storing information of feature rules;
wherein the method comprises the following steps:
receiving a feature rule processing instruction, wherein the feature rule processing instruction comprises a feature rule processing type and feature rule information;
determining a target sub-library according to the feature rule processing instruction, and updating the target sub-library based on the feature rule processing type and the feature rule information;
determining a target sub-library updated in a preset time interval according to the preset time interval;
compiling the updated target sub-library, and updating the feature rule matching library according to the feature rule matching sub-library obtained by compiling.
2. The method of claim 1, wherein the feature rule processing type comprises an increment, wherein the determining a target sub-library according to the feature rule processing instruction, and wherein updating the target sub-library based on the feature rule processing type and the feature rule information comprises:
when the feature rule processing type is increasing, determining current available sub-libraries, and determining any sub-library in the current available sub-libraries as a target sub-library;
if the current available sub-library is empty, a new sub-library is created, and the newly created sub-library is determined as the target sub-library;
and adding the characteristic string in the characteristic rule information into the target sub-library.
3. The method according to claim 2, wherein an available sub-library list is provided in the electronic device, and the available sub-library list comprises identification information of a currently available sub-library;
wherein the determining a currently available sublibrary comprises:
and reading the identification information of the currently available sub-library from the available sub-library list, and determining the currently available sub-library based on the identification information of the currently available sub-library.
4. The method of claim 3, after adding the feature string in the feature rule information to the target sub-library, further comprising:
adding the identification information of the newly-built sub-library into the available sub-library list;
when the target sub-library is full, removing the identification information of the target sub-library from the list of available sub-libraries.
5. The method of claim 3, after compiling the updated target sub-library, further comprising:
emptying the available sublibrary list;
and traversing each sub-library, determining the sub-library with the residual capacity larger than the preset value as a current available sub-library, and generating a new available sub-library list according to the identification information of the current available sub-library.
6. The method of claim 1, wherein the feature rule processing type comprises deletion, wherein the determining a target sub-library according to the feature rule processing instruction, and wherein updating the target sub-library based on the feature rule processing type and the feature rule information comprises:
when the feature rule processing type is deletion, inquiring in each sub-library based on identification information in the feature rule information, and determining the sub-library where the feature rule information to be deleted is located as a target sub-library;
and deleting the characteristic string in the characteristic rule information in the target sub-library.
7. The method of claim 1, wherein after updating the target sub-library based on the feature rule processing type and the feature rule information, the method further comprises:
adding the identification information of the target sub-library into an updated sub-library list;
wherein the determining of the target sub-library updated within the preset time interval includes:
determining an updated target sub-library based on the identification information in the updated sub-library list, wherein the updated sub-library list is emptied after compiling the updated target sub-library.
8. The method of claim 1, further comprising, after updating the feature rule matching library according to the compiled feature rule matching sub-library:
acquiring a read lock, wherein the read lock is used for refusing access to an original feature rule matching library;
replacing the original feature rule matching library based on the updated feature rule matching library;
releasing the read lock.
9. The device for updating the feature rule matching library is characterized by comprising a plurality of independent sub-libraries with preset capacity, wherein the sub-libraries are used for storing information of feature rules;
wherein the apparatus comprises:
the processing instruction receiving module is used for receiving a feature rule processing instruction, wherein the feature rule processing instruction comprises a feature rule processing type and feature rule information;
the target sub-library updating module is used for determining a target sub-library according to the characteristic rule processing instruction and updating the target sub-library based on the characteristic rule processing type and the characteristic rule information;
the updating sub-library determining module is used for determining a target sub-library which is updated within a preset time interval according to the preset time interval;
and the feature rule matching library updating module is used for compiling the updated target sub-library and updating the feature rule matching library according to the feature rule matching sub-library obtained by compiling.
10. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a method of updating a feature rule matching library as claimed in any one of claims 1 to 8.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements a method of updating a feature rule matching library according to any one of claims 1 to 8.
CN201911007578.9A 2019-10-22 2019-10-22 Method and device for updating feature rule matching library, storage medium and electronic equipment Active CN110716946B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911007578.9A CN110716946B (en) 2019-10-22 2019-10-22 Method and device for updating feature rule matching library, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911007578.9A CN110716946B (en) 2019-10-22 2019-10-22 Method and device for updating feature rule matching library, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN110716946A true CN110716946A (en) 2020-01-21
CN110716946B CN110716946B (en) 2022-05-10

Family

ID=69213136

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911007578.9A Active CN110716946B (en) 2019-10-22 2019-10-22 Method and device for updating feature rule matching library, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110716946B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112131806A (en) * 2020-11-25 2020-12-25 芯华章科技股份有限公司 Compilation method for verification design, electronic device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104391913A (en) * 2014-11-18 2015-03-04 北京锐安科技有限公司 Database management method and device
US20170046412A1 (en) * 2014-04-01 2017-02-16 Huawei Technologies Co., Ltd. Method for Querying and Updating Entries in a Database
CN108628947A (en) * 2018-04-02 2018-10-09 阿里巴巴集团控股有限公司 A kind of business rule matched processing method, device and processing equipment
CN109783802A (en) * 2018-12-13 2019-05-21 平安医疗健康管理股份有限公司 A kind of business rule processing method, server and computer readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170046412A1 (en) * 2014-04-01 2017-02-16 Huawei Technologies Co., Ltd. Method for Querying and Updating Entries in a Database
CN104391913A (en) * 2014-11-18 2015-03-04 北京锐安科技有限公司 Database management method and device
CN108628947A (en) * 2018-04-02 2018-10-09 阿里巴巴集团控股有限公司 A kind of business rule matched processing method, device and processing equipment
CN109783802A (en) * 2018-12-13 2019-05-21 平安医疗健康管理股份有限公司 A kind of business rule processing method, server and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
耿俊 等: "基于EPS地理信息工作站的地形数据连库增量更新技术研究", 《测绘与空间地理信息》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112131806A (en) * 2020-11-25 2020-12-25 芯华章科技股份有限公司 Compilation method for verification design, electronic device and storage medium

Also Published As

Publication number Publication date
CN110716946B (en) 2022-05-10

Similar Documents

Publication Publication Date Title
CN110297689B (en) Intelligent contract execution method, device, equipment and medium
CN109558525B (en) Test data set generation method, device, equipment and storage medium
CN109471851B (en) Data processing method, device, server and storage medium
CN109726217B (en) Database operation method, device, equipment and storage medium
CN110764748B (en) Code calling method, device, terminal and storage medium
CN110960855A (en) Communication protocol code updating method and device, electronic equipment and storage medium
CN114138281A (en) Compiling method, device, equipment and medium of software engineering
CN110716946B (en) Method and device for updating feature rule matching library, storage medium and electronic equipment
CN110990346A (en) File data processing method, device, equipment and storage medium based on block chain
CN110659210A (en) Information acquisition method and device, electronic equipment and storage medium
US20130152049A1 (en) Warning of register and storage area assignment errors
US9064042B2 (en) Instrumenting computer program code by merging template and target code methods
CN106502707B (en) Code generation method and device
CN111104347B (en) Heap memory block searching method, device, equipment and storage medium
CN112039975A (en) Method, device, equipment and storage medium for processing message field
CN110175128B (en) Similar code case acquisition method, device, equipment and storage medium
CN111694992B (en) Data processing method and device
CN111736848B (en) Packet conflict positioning method, device, electronic equipment and readable storage medium
US9921814B2 (en) Control flow graph analysis
CN114547086A (en) Data processing method, device, equipment and computer readable storage medium
CN114020789A (en) Bill data query method, system, device and storage medium
CN112947941A (en) Method and device for adding exception handling code
US10620946B1 (en) Dynamic modeling for opaque code during static analysis
CN111782834A (en) Image retrieval method, device, equipment and computer readable storage medium
CN110334098A (en) A kind of database combining method and system based on script

Legal Events

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