Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment of the application provides a method for processing incremental data of a software component database. An execution body of a method for incremental data processing of a software component database includes, but is not limited to, at least one of a server, a terminal, and the like, which can be configured to execute the method provided by the embodiments of the present application. In other words, a method for incremental data processing of a software component database may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The service side includes, but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Referring to fig. 1, a flowchart of a method for incremental data processing in a software component database according to an embodiment of the invention is shown.
S1, acquiring incremental data requirements of a software component database, and extracting an incremental data operation log corresponding to the incremental data requirements from a pre-constructed log database.
In the embodiment of the invention, the software component database is a SCA (Software Composition Analysis, software component analysis) knowledge base, and can provide detailed data support for various software component information and interrelationships thereof related to components, vulnerabilities, permissions and the like. Incremental data requirements are specific requirements of a business party for incremental updates to a software component database, e.g., time periods of updates, content, data formats of updates, etc., by which the software component database can be updated in a targeted manner.
In the embodiment of the invention, the log database records how a piece of data is operated at a moment in the software component database, so that the incremental data corresponding to the incremental data requirement can be determined by operating the log through the incremental operation data so as to update the software component database.
In the embodiment of the invention, the extracting the incremental data operation log corresponding to the incremental data requirement in the pre-constructed log database comprises the following steps: determining an incremental data upgrading period and an upgrading key field according to the incremental data demand; performing field matching in a log database according to the incremental data upgrading period and the upgrading key field to obtain a matching log; and extracting a matching log from the log database to obtain an incremental data operation log corresponding to the incremental data requirement.
In the embodiment of the present invention, the incremental data update period is a period in which an incremental data need to be updated, for example, one day is updated, the incremental data update period is one day, the update key field is a specific operation in which data update is required to be performed on the software database, for example, the incremental data need is newly added data need to be updated, and the update key field is updated.
According to the embodiment of the invention, the corresponding incremental data operation log can be accurately extracted from the log database according to the incremental data upgrading period and the upgrading key field, for example, the incremental data upgrading period is one day, the upgrading key field is data updating, then the log data of data updating operation in one day is matched in the log database to obtain the matched log, and the matched log is collected to obtain the incremental data operation log corresponding to the incremental data requirement.
S2, classifying the data of the incremental data operation log to obtain an operation category log of the incremental data operation log.
In the embodiment of the invention, the data classification is to classify different data operation types in the incremental data operation log, for example, data classification is performed on operations such as adding, modifying and deleting data, so as to obtain an operation type log corresponding to the operation type without the incremental data.
In the embodiment of the invention, the data classification is carried out on the incremental data operation log to obtain the operation category log of the incremental data operation log, which comprises the following steps: identifying the operation type of each incremental data operation log in the incremental data operation logs according to a preset operation type field; and classifying the incremental data operation logs according to the operation types to obtain operation type logs of the incremental data operation logs.
In the embodiment of the invention, the operation type field is a field of how the corresponding data in each incremental data operation is operated, for example, an operation type field such as adding, modifying and deleting, so that the operation type of each incremental data operation log in the incremental data operation log can be identified through the operation type field, and further the incremental data operation log can be classified to obtain operation type logs of different operation types.
In the embodiment of the invention, the incremental operation logs are conveniently converted into the incremental data packets corresponding to the incremental data demands according to the operation types by classifying the data of the incremental operation logs, so that the incremental data demands of different clients are better met.
S3, converting the incremental data operation log into an incremental data packet corresponding to the incremental data requirement according to the operation type log.
In the embodiment of the invention, the incremental data packet is a data packet for carrying out incremental data upgrading on the software component database, and the incremental data upgrading operation, such as updating, adding, deleting and the like, is carried out on the software component database by utilizing the data in the incremental data packet.
In the embodiment of the present invention, referring to fig. 2, a specific implementation process for converting an incremental data operation log into an incremental data packet corresponding to an incremental data requirement according to an operation type log includes: s21, performing data screening on the incremental data operation log according to the operation category log to obtain a target log; s22, converting the target log into a data format corresponding to the incremental data requirement to obtain the requirement incremental data; s23, data packaging is carried out on the demand incremental data, and an incremental data packet corresponding to the incremental data demand is obtained.
In the embodiment of the invention, the data screening is to select different data from the incremental data operation log according to the operation type corresponding to the operation type log, for example, if the operation type is newly added, the unique identifier and all field information of the incremental data operation log are written; if the operation type is data deletion, writing in a unique identifier of the operation type; if the operation type is modification, writing in a unique identifier and modified specific information to obtain a target log, wherein the unique identifier can be a name of each data in the incremental data operation log, for example, the incremental data operation log is used for carrying out data modification on the data 1, and the data 1 is the unique identifier in the incremental data operation log.
In the embodiment of the invention, the data conversion is to convert the target log into the required data format according to the incremental data requirement, for example, the service party A needs to use the component data of the SCA knowledge base, and the risk of the component is required to be displayed in the form of Chinese characters (such as super-risk, high-risk and medium-risk), and then the fields in the target log need to be subjected to format conversion and displayed in the form of Chinese characters, so as to obtain the required incremental data. Specifically, different data conversion templates can be customized according to the requirement of the incremental data to obtain the required incremental data.
In the embodiment of the invention, the data package is carried out on the demand incremental data to obtain the incremental data packet corresponding to the demand of the incremental data, which comprises the following steps: converting the demand increment data into standard data corresponding to a preset data protocol; and carrying out data encapsulation on the standard data according to a protocol encapsulation strategy corresponding to the data protocol to obtain an incremental data packet corresponding to the incremental data requirement.
In the embodiment of the present invention, the data protocol is a rule and convention that must be followed for communication or service, the protocol defines a format of data usage, and information and meaning, a connection mode, and a timing sequence of information transmission and reception should be included, so as to ensure that data in a network is smoothly transmitted to a specified address, and therefore, it is required to convert requirement increment data into standard data corresponding to a preset data protocol, for example, into standard data corresponding to a BSC protocol (binary synchronous communication protocol) in a basic unit of characters, or into standard data corresponding to HDLC (advanced data link control protocol) in a basic unit of bits.
In the embodiment of the invention, the protocol encapsulation policy is information necessary for the data encapsulation algorithm, for example, a frame format corresponding to the data protocol, and standard data is written into the frame format corresponding to the protocol encapsulation policy through the protocol encapsulation policy, so as to perform data encapsulation on the standard data, and obtain an incremental data packet.
In the embodiment of the invention, the data corresponding to the incremental data upgrading needs can be totally encapsulated through the incremental data packet, so that the incremental data can be directly upgraded to the software component database by utilizing the incremental data packet, and the efficiency of the incremental data upgrading is improved.
And S4, performing incremental data upgrading on the software component database by utilizing the incremental data packet to obtain an upgraded software component database.
In the embodiment of the invention, the incremental data upgrading is to update the data by utilizing the incremental data package to add, delete, change and other operations of the data in the software component database, so as to realize the upgrading of the software component database.
In the embodiment of the invention, incremental data is updated on a software component database by utilizing an incremental data packet to obtain an updated software component database, and the method comprises the following steps: data unpacking is carried out on the incremental data packet to obtain upgrade data; searching data to be updated in a software component database according to the upgrade data; updating the data to be updated by using the upgrade data to obtain an upgrade software component database.
In the embodiment of the invention, the unpacking is to unpack the data packet of the incremental data packet to obtain the upgrade data for upgrading the incremental data of the software component database, wherein the data unpacking can be performed by using the reverse process converted into the incremental data packet.
In the embodiment of the invention, the data to be updated can be searched in the software component database according to the data representation in the incremental data operation log corresponding to the upgrade data, for example, the upgrade data is the incremental data upgrade required to be performed by the incremental data operation log corresponding to the data A, so that the data A is searched in the software component database to obtain the data to be updated.
In the embodiment of the invention, updating data to be updated by using upgrade data to obtain an upgrade software component database comprises the following steps: invoking a preset data updating rule according to the operation type of the upgrade data; updating the data to be updated by utilizing the updating data according to the data updating rule to obtain an updating software component database.
In the embodiment of the invention, the operation class of the upgrade data is the operation class of the incremental data operation log of each upgrade data, for example, the addition, deletion, modification and the like of the data, and different operation classes need to perform different updating operations on the data to be updated, so that different data updating rules can be called according to the operation class, for example, when the operation class is the addition, the upgrade data can be directly added after the data to be updated, and when the operation class is the modification, the data updating rules such as data replacement and the like can be performed on the data to be updated by utilizing the upgrade data to perform data updating on the data to be updated, thereby realizing the incremental data updating of the software component database.
In the embodiment of the invention, the incremental data of the software component database is updated through the incremental data packet, so that the incremental data of the software component database can be directly and comprehensively updated, different incremental data requirements can be better met, and the incremental data updating efficiency is improved.
According to the embodiment of the invention, the corresponding incremental data operation log is extracted from the pre-constructed log database through the incremental data requirement, and the incremental data corresponding to the incremental data requirement can be determined so as to update the software component database; the incremental operation logs are subjected to data classification to obtain operation category logs, so that the incremental data operation logs can be conveniently converted into incremental data packets corresponding to incremental data requirements according to the operation categories, and further the incremental data requirements of different clients can be better met; the operation type log is converted into the incremental data packet corresponding to the incremental data requirement, so that all data corresponding to the incremental data upgrading requirement can be packaged, and the incremental data upgrading efficiency is improved; the incremental data of the software component database is updated by utilizing the incremental data packet, so that the incremental data of the software component database can be directly and comprehensively updated, and the efficiency of the incremental data updating is further improved. Therefore, the incremental data processing method for the software component database can solve the problems of pertinence and poor efficiency of updating the software component database.
Fig. 3 is a functional block diagram of an apparatus for incremental data processing of a software component database when applied to a client according to an embodiment of the present invention.
The apparatus 300 for incremental data processing of a software component database according to the present invention may be installed in an electronic device. Depending on the functionality implemented, an apparatus 300 for incremental data processing of a software component database may include an incremental data operation log extraction module 301, a data classification module 302, an incremental data packet conversion module 303, and an incremental data upgrade module 304. The module of the invention, which may also be referred to as a unit, refers to a series of computer program segments, which are stored in the memory of the electronic device, capable of being executed by the processor of the electronic device and of performing a fixed function.
In the present embodiment, the functions concerning the respective modules/units are as follows: the incremental data operation log extraction module 301 is configured to obtain an incremental data requirement of the software component database, and extract an incremental data operation log corresponding to the incremental data requirement in the pre-constructed log database; the data classification module 302 is configured to perform data classification on the incremental data operation log to obtain an operation class log of the incremental data operation log; the incremental data packet conversion module 303 is configured to convert the incremental data operation log into an incremental data packet corresponding to the incremental data requirement according to the operation class log. The incremental data upgrading module 304 is configured to upgrade incremental data of the software component database by using the incremental data packet, so as to obtain an upgraded software component database.
In detail, in one embodiment, each module in the apparatus 300 for processing incremental data of a software component database adopts the same technical means as the method for processing incremental data of a software component database in the drawings, and can produce the same technical effects, which are not described herein.
Fig. 4 is a schematic structural diagram of an electronic device for implementing a method for incremental data processing of a software component database according to an embodiment of the present invention.
Electronic device 400 may include a processor 401, a memory 402, a communication bus 403, and a communication interface 404, and may also include computer programs stored in memory 402 and executable on processor 401, such as a program for incremental data processing of a software component database.
The processor 401 may be composed of an integrated circuit in some embodiments, for example, may be composed of a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, including one or more central processing units (Central Processing Unit, CPU), a microprocessor, a digital processing chip, a combination of a graphics processor and various control chips, etc. The processor 401 is a Control Unit (Control Unit) of the electronic device, connects the respective components of the entire electronic device using various interfaces and lines, executes or executes programs or modules stored in the memory 402 (for example, a program for executing a software component database incremental data process, etc.), and invokes data stored in the memory 402 to perform various functions of the electronic device and process data.
Memory 402 comprises at least one type of readable storage medium including flash memory, a removable hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 402 may in some embodiments be an internal storage unit of the electronic device, such as a mobile hard disk of the electronic device. The memory 402 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the electronic device. Further, the memory 402 may also include both internal storage units and external storage devices of the electronic device. The memory 402 may be used not only for storing application software installed in an electronic device and various types of data, such as code of a program for incremental data processing based on a software component database, or the like, but also for temporarily storing data that has been output or is to be output.
The communication bus 403 may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, or the like. The bus may be classified as an address bus, a data bus, a control bus, etc. The bus is arranged to enable connected communication between the memory 402 and the at least one processor 401 etc.
The communication interface 404 is used for communication between the electronic device and other devices described above, including network interfaces and user interfaces. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), or alternatively a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device and for displaying a visual user interface.
Fig. 4 illustrates only an electronic device having components, and it will be appreciated by those skilled in the art that the configuration illustrated in fig. 4 is not limiting of electronic device 400 and may include fewer or more components than illustrated, or may combine certain components, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power source (such as a battery) for supplying power to the respective components, and the power source may be logically connected to the at least one processor 401 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device may also include various sensors, bluetooth modules, wi-Fi modules, etc., which are not described in detail herein.
It should be understood that the examples are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The invention also provides a computer readable storage medium storing a computer program which, when executed by a processor, implements a method for incremental data processing of a software component database according to any of the above embodiments. The computer-readable storage medium may be volatile or nonvolatile. For example, the computer readable medium may include: any entity or device capable of carrying computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM). In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of modules is merely a logical function division, and other manners of division may be implemented in practice.
The modules illustrated as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.