CN117971127A - Information management method, device and server - Google Patents

Information management method, device and server Download PDF

Info

Publication number
CN117971127A
CN117971127A CN202410208429.3A CN202410208429A CN117971127A CN 117971127 A CN117971127 A CN 117971127A CN 202410208429 A CN202410208429 A CN 202410208429A CN 117971127 A CN117971127 A CN 117971127A
Authority
CN
China
Prior art keywords
additional information
management
writing
address
mode
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410208429.3A
Other languages
Chinese (zh)
Inventor
廖山清
钱磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Knownsec Information Technology Co ltd
Original Assignee
Chengdu Knownsec Information Technology Co ltd
Filing date
Publication date
Application filed by Chengdu Knownsec Information Technology Co ltd filed Critical Chengdu Knownsec Information Technology Co ltd
Publication of CN117971127A publication Critical patent/CN117971127A/en
Pending legal-status Critical Current

Links

Abstract

The application provides a message management method, a message management device and a server, and belongs to the field of data processing. After receiving the storage request, obtaining additional information to be stored and the IP address corresponding to the additional information, determining a writing mode according to the number of the IP addresses in the storage request. Meanwhile, each IP address is converted into an integer to be used as a management index of the additional information of the IP address, so that each additional information is written into a storage area corresponding to the management index in a management file of the magnetic disk according to a writing mode. Therefore, the storage of the additional information does not need to store an IP address and manage by using a database system, so that the storage complexity is greatly reduced, and the high efficiency of data management can be improved.

Description

Information management method, device and server
Technical Field
The present application relates to the field of data processing, and in particular, to an information management method, an information management device, and a server.
Background
IPv4 (Internet Protocol version, internet protocol version 4) is an internet protocol for device identification and location on data networks. IPv4 is not only an identification of internet devices, but is often associated with additional information such as user information, geographic location, and device characteristics. With the development and expansion of global networks, IPv4 address space is increasingly used, and is huge in number. Consequently, management of IPv4 addresses and storage and retrieval of additional information for IPv4 addresses are an important challenging task.
Currently, to meet the data storage and query requirements associated with IPv4 addresses, data management is often relied upon with conventional database systems. However, this approach is inefficient in data management (including storage and querying), and cannot meet the needs of applications that require immediate response.
Disclosure of Invention
In view of the above, an object of the present application is to provide an information management method, an information management device, and a server, which can solve the problem of low data management efficiency in the conventional information management method.
In order to achieve the above object, the technical scheme adopted by the embodiment of the application is as follows:
in a first aspect, an embodiment of the present application provides an information management method, applied to a server, where the method includes:
Receiving a storage request to obtain additional information to be stored and an IP address corresponding to the additional information;
determining a writing mode according to the number of the IP addresses;
Converting the IP address into an integer for each IP address, and taking the integer as a management index of additional information of the IP address; wherein each of the additional information corresponds to a unique management index;
And writing each piece of additional information into a storage area corresponding to the management index of the additional information in the management file according to the writing mode.
In one possible embodiment, the method further comprises:
Acquiring a search request and analyzing an IP address in the search request;
determining a reading mode according to the number of IP addresses in the search request;
Converting each IP address in the search request into an integer form of management index;
and reading the additional information of each IP address in the search request from the management file according to the reading mode and the management index, and generating a search result.
In one possible implementation, the server includes a disk and a memory, where the disk includes a management file;
the step of reading the additional information of each IP address in the search request from the management file according to the reading mode and the management index, and generating a search result includes:
When the reading mode is batch reading, sequencing all the IP addresses analyzed from the retrieval request to obtain a starting address and a terminating address;
Taking an index section between a start index corresponding to the start address and a stop index corresponding to the stop address as a mapping section;
Mapping the additional information in the storage area corresponding to the mapping section in the management file to the memory to obtain a query file in the memory;
and obtaining a search result from the query file according to the management indexes of all IP addresses in the search request.
In one possible implementation, the server includes a disk and a memory, where the disk includes a management file;
The step of writing each additional information into the storage area corresponding to the management index of the additional information in the management file according to the writing mode includes:
when the writing mode is batch writing, dividing all additional information to be stored into at least one batch writing group;
and for each batch writing group, loading all additional information of the batch writing group to the memory, accessing the disk, and writing the additional information in the memory into a storage area corresponding to a management index of the additional information in the management file at one time.
In one possible implementation manner, the step of writing each piece of the additional information into the storage area corresponding to the management index of the additional information in the management file according to the writing mode includes:
when the writing mode is one by one writing, writing the additional information one by one into a storage area corresponding to a management index of the additional information in the management file.
In one possible implementation manner, the step of reading the additional information of each IP address in the search request from the management file according to the reading mode and the management index to generate a search result includes:
and when the reading mode is one by one reading, reading the additional information in the storage area corresponding to each management index from the management file one by one to obtain a retrieval result.
In a possible implementation manner, the step of determining the writing mode according to the number of the IP addresses includes:
judging whether the number of the IP addresses exceeds a preset batch threshold value or not;
If yes, determining the writing mode as batch writing;
If not, determining the writing mode as writing one by one.
In a possible implementation manner, the step of determining the reading mode according to the number of the IP addresses in the search request includes:
judging whether the number of the IP addresses in the search request exceeds a preset batch threshold value or not;
If yes, determining that the reading mode is batch reading;
if not, determining the reading mode as reading one by one.
In a second aspect, an embodiment of the present application provides an information management apparatus, applied to a server, where the information management apparatus includes a data acquisition module, a mode determination module, a conversion module, and a writing module;
The data acquisition module is used for receiving a storage request and obtaining additional information to be stored and an IP address corresponding to the additional information;
The mode determining module is used for determining a writing mode according to the number of the IP addresses;
the conversion module is used for converting the IP address into an integer for each IP address and taking the integer as a management index of the additional information of the IP address;
and the writing module is used for writing each piece of additional information into a storage area corresponding to the management index of the additional information in the management file according to the writing mode.
In a third aspect, an embodiment of the present application provides a server, including a processor and a memory, where the memory stores machine executable instructions executable by the processor, the processor being capable of executing the machine executable instructions to implement an information management method according to any one of the possible implementation manners of the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements an information management method according to any one of the possible implementation manners of the first aspect.
According to the information management method, the information management device and the server provided by the embodiment of the application, after a storage request is received, additional information to be stored and an IP address corresponding to the additional information are obtained, a writing mode is determined according to the number of the IP addresses in the storage request, and meanwhile, each IP address is converted into an integer to serve as a management index of the additional information of the IP address, so that each additional information is written into a storage area corresponding to the management index in a management file of a magnetic disk according to the writing mode. Therefore, the storage of the additional information does not need to store an IP address and manage by using a database system, so that the storage complexity is greatly reduced, and the high efficiency of data management can be improved.
In order to make the above objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 shows a schematic structural diagram of an information management system according to an embodiment of the present application.
Fig. 2 shows one of flow diagrams of an information management method according to an embodiment of the present application.
Fig. 3 shows a schematic flow chart of part of the sub-steps of step S17 in fig. 2.
Fig. 4 shows a second flowchart of an information management method according to an embodiment of the present application.
Fig. 5 shows a schematic flow chart of a partial sub-step of step S27 in fig. 4.
Fig. 6 shows a schematic structural diagram of an information management apparatus according to an embodiment of the present application.
Fig. 7 shows a schematic structural diagram of a server according to an embodiment of the present application.
Reference numerals illustrate: 1000-an information management system; 10-client; 20-a server; 30-an information management device; 301-a data acquisition module; 302-a mode determination module; 303-a conversion module; 304-write module.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present application.
It is noted that relational terms such as "first" and "second", and the like, are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Currently, to meet the large number of data storage and query requirements associated with IPv4 addresses, conventional database systems are typically employed for data management. The database system stores the IP address and the additional information together and generates a corresponding index for searching, and the method has low speed and high delay, is not suitable for large-scale, high-speed and real-time IPv4 address data storage, query and search, and causes low data management efficiency.
However, for applications requiring immediate response, such as real-time network monitoring, fraud detection, or advertisement positioning, the database system cannot meet the requirements due to slow data management speed and high delay.
Based on the above consideration, the embodiment of the application provides an information management method, which can improve the speed of data management, reduce delay and improve management efficiency, so as to meet the requirement of instant response application.
The information management method provided by the embodiment of the application can be applied to the information management system 1000 shown in fig. 1, the information management system 1000 can include a server 20 and a plurality of clients 10, and each client 10 can be provided with an instant response application, for example, a network monitoring application or a network security protection application. The server 20 may be communicatively connected to a plurality of clients 10 via a network.
The server 20 may include a memory and a disk, and the disk may have a management file disposed thereon, and the management file may include a plurality of storage areas. The storage area may be a row space or a column space, and is not particularly limited in this embodiment.
When the memory area is a line space, the management index of each line space may be the line number of the line. When the memory area is a column space, the management index of each column space may be the column number of the column.
In one possible embodiment, the present application provides an information management method, referring to fig. 2, which may include the following steps. In the present embodiment, the information management method is applied to the server 20 in fig. 1 for illustration.
S11, receiving a storage request to obtain additional information to be stored and an IP address corresponding to the additional information.
S13, determining a writing mode according to the number of the IP addresses.
S15, converting the IP address into an integer for each IP address, and using the integer as a management index of additional information of the IP address.
S17, according to the writing mode, writing each piece of additional information into a storage area corresponding to the management index of the additional information in the management file.
Wherein, the IP address may be an IPv4 address, and each additional information corresponds to a unique management index. Step S13 and step S15 may be performed simultaneously, or the order may be arbitrarily changed.
When the addresses are IPv4 addresses, each IPv4 address can be converted into an integer, and the integer corresponding to each IPv4 address is unique. The IPv4 address is composed of four bytes, each ranging from 0 to 255. Thus, converting IPv4 to integers, each IPv4 address may correspond to a unique integer, and may range from 0 to 4294967295.
The conversion formula may be: the first set of digits x 256 3 + the second set of digits x 256 2 + the third set of digits x 256 1 + the fourth set of digits x 256 0.
For example, if the IPv4 address is "0.0.0.0", the corresponding integer may be 0, if the IPv4 address is "0.0.1", the corresponding integer may be 1, and if the IPv4 address is "1.2.3.4", the converted integer value may be 16909060.
After additional information of the newly obtained IP address needs to be stored, the client 10 may initiate a storage request to the server 20. After receiving the storage request, the server 20 parses the storage request to obtain additional information to be stored and an IP address corresponding to each additional information. Further, the server 20 can determine the writing method based on the acquired data of the IP address. Meanwhile, the server 20 may convert each IP address into an integer as a management index of additional information of the IP address.
After determining the management index and the writing manner, the server 20 writes each additional information into the storage area corresponding to the management index of the additional information in the management file according to the writing mode.
For example, if the storage area is a line space, there are additional information a, additional information B, and additional information C, the management index of the additional information a is 255, the management index of the additional information B is 300, and the management index of the additional information C is 500, the additional information a is written into the storage area with the line number 255 in the management file, the additional information B is written into the storage area with the line number 300 in the management file, and the additional information C is written into the storage area with the line number 500 in the management file according to the writing method.
Compared with the traditional data management mode using a database system, the information management method provided by the application does not need to store the IP address and the index, converts the IP address into an integer and then uses the integer as the management index, and stores the additional information of the IP address in the storage area corresponding to the management index. The storage flow is greatly simplified, and the storage complexity is reduced, so that the speed of data storage can be improved, and the high efficiency of data management is improved.
When data is written into the management file, the more times the disk I/O is accessed, the greater the resource consumption, the slower the speed, and the lower the efficiency. Based on the method, different writing modes can be adopted according to the quantity of the additional information to be stored, so that the access times of the disk I/O can be reduced as much as possible in the data storage process, and the efficiency is improved.
Specifically, in step S13, it may be determined whether the number of IP addresses in the storage request exceeds a preset batch threshold, if so, the writing mode is determined to be batch writing, and if not, the writing mode is determined to be writing one by one.
For example, the batch threshold may be 1, when the number of IP addresses in the storage request is greater than 1, then the write mode is batch writing, otherwise, the write mode is writing one by one.
It should be understood that the batch threshold may be adjusted according to the actual requirement of the application scenario, and in this embodiment, the batch threshold is not specifically limited.
In order to reduce the number of accesses to the disk I/O as much as possible under the limitation of memory resources, referring to fig. 3, step S17 may be further implemented as the following steps.
S171, when the writing mode is batch writing, all the additional information to be stored is divided into at least one batch writing group.
S172, for each batch writing group, loading all additional information of the batch writing group into a memory, accessing a disk, and writing the additional information in the memory into a storage area corresponding to a management index of the additional information in the management file at one time.
For step S171, a grouping threshold may be set according to an upper limit of the memory resources. When the write mode is batch write, all the additional information to be stored is divided into at least one batch write group according to the grouping threshold. And, the amount of additional information per batch write group does not exceed the grouping threshold.
Taking the write threshold value as 10 as an example, if the number of all the additional information to be stored is less than or equal to 10, all the additional information to be stored forms a batch write group. If the number of all the additional information to be stored is 24, the method can be divided into three batch writing groups, and the number of the additional information in the three batch writing groups can be 10, 10 and 2, or 8, 8 and 8 respectively.
After the batch writing groups are divided, all the additional information of the batch writing groups are loaded into the memory for each batch writing group, and then the disk is accessed, so that all the additional information in the memory is written into a storage area corresponding to the management index of each additional information in the management file at one time.
Thus, for all the additional information in the same batch write group, the additional information of the batch write group can be written into the management file only by accessing the disk I/O once.
When the writing mode is one by one writing, the additional information can be written one by one into the storage area corresponding to the management index of the additional information in the management file.
By the method, under the condition of considering the limitation of memory resources, the access times of the disk I/O during storage are reduced as much as possible, and when a plurality of additional information is stored, the additional information can be written in at one time, so that the storage speed can be greatly improved, and the management efficiency can be further improved.
In a possible implementation manner, in step S13, when determining the writing mode, the current available memory resources of the server 20 may also be considered, so as to avoid a crash due to an excessive memory usage rate.
Specifically, in step S13, the current memory usage rate of the server 20 may be obtained, and if the memory usage rate is greater than or equal to a preset crash threshold, it is determined that the writing mode is writing one by one. If the memory utilization is smaller than the preset collapse threshold, determining a writing mode according to the number of the IP addresses.
Meanwhile, when the writing mode is batch writing, the residual memory can be calculated according to the memory utilization rate, and the grouping threshold value can be calculated according to the residual memory. Further, all additional information to be stored is divided into at least one batch write group according to the grouping threshold.
By the above manner, when the additional information to be stored is too much under the condition that the server 20 is prevented from crashing due to too high memory usage rate, batch writing can be performed, so that the number of I/O accessing to the disk is reduced as much as possible, the storage speed is improved, and the data management efficiency is improved.
In addition, in order to further increase the writing speed, when the number of additional information to be stored acquired from the storage request is a plurality of, after the IP address is converted into an integer, all the additional information to be stored may be sorted according to the size of the integer, and further, the additional information may be written to the management file according to the order. In this way, disk I/O operations can be reduced.
In one possible embodiment, in order to reduce the delay of data retrieval and further improve the efficiency of data management, when information is stored in steps S11 to S17, the concept of using the integer corresponding to the IP address as the management index is also introduced in data retrieval and query. Referring to fig. 4, the information management method provided by the present application may further include the following steps.
S21, acquiring a search request, and analyzing an IP address in the search request.
S23, determining a reading mode according to the number of the IP addresses in the search request.
S25, converting each IP address in the search request into an integer form management index.
S27, reading the additional information of each IP address in the search request from the management file according to the reading mode and the management index, and generating a search result.
The steps S23 and S25 may be performed in parallel or may be performed in any order.
When any of the on-demand applications on the client 10 needs to query for additional information for one or more IP addresses, the client 10 may initiate a retrieval request to the server 20. The server 20 parses the received retrieval request to obtain the IP address to be retrieved. The server 20 may determine the read mode from the data of the IP addresses to be retrieved while converting each IP address in the retrieval request into a management index in the form of an integer.
After determining the reading mode and the management index of each IP address in the search request, the server 20 reads the storage area corresponding to the management index in the management file according to the reading mode and the management index, obtains the additional information of each IP address in the search request, and generates and feeds back the search result to the client 10.
Compared with the traditional method for data management by adopting a database system, the method provided by the application has the advantages that when in retrieval, the information of the storage area corresponding to the IP address converted into the integer in the management file is directly needed, other conversion and processing flows are not needed, the retrieval flow is greatly simplified, the instant response is realized, and the data retrieval efficiency can be improved.
When data retrieval or request is performed, the disk I/O needs to be accessed to read data from the management file, and the more the number of times of accessing the disk I/O, the higher the delay, the slower the response speed, and the lower the efficiency. Based on the method, different reading modes can be adopted according to the number of the IP addresses in the search request, so that the access times of the disk I/O can be reduced as much as possible, and the reading speed and the response efficiency can be improved.
Specifically, in step S23, it may be determined whether the number of IP addresses in the search request exceeds a preset batch threshold, if so, the reading mode is determined to be batch reading, and if not, the reading mode is determined to be reading one by one.
In order to raise response speed and reduce delay as much as possible and raise instant response speed and efficiency when data search or inquiry is performed, memory mapping file technology is introduced in data reading. Referring to fig. 5, step S27 may be further implemented as the following steps.
And S271, when the reading mode is batch reading, sequencing all the IP addresses analyzed from the retrieval request to obtain a start address and a termination address.
S272, an index segment between a start index corresponding to the start address and a stop index corresponding to the stop address is used as a mapping segment.
S273, the additional information in the storage area corresponding to the mapping section in the management file is mapped to the memory to obtain the query file in the memory.
S274, according to the management indexes of all IP addresses in the search request, the search result is obtained from the query file.
For example, when the read mode is batch read, if the number of IP addresses in the search request is five, the IP addresses are respectively: "1.2.3.4", "1.2.3.1", "0.2.3.4", "0.2.3.2" and "0.0.3.4" are then "0.0.3.4", "0.2.3.2", "0.2.3.4", "1.2.3.1" and "1.2.3.4" in order from small to large. The start address is "0.0.3.4", the end address is "1.2.3.4", the corresponding start index is 772, and the end index is 16909060.
At this time, the additional information of the storage area with the index between 772 and 16909060 in the management file can be mapped onto the memory by using the memory mapping file technology, and the query file is formed on the memory. Further, the search result can be generated by searching the additional information of the management index pair of each IP address from the search file.
In S27, when the reading mode is reading one by one, the additional information in the storage area corresponding to each management index is read one by one from the management file, and a search result is obtained.
Through the steps S271 to S274, when the IP addresses in the search request are multiple, the additional information in the relevant storage area in the management file is directly mapped to the memory at one time, so that the memory mapped query file is queried, and access to the disk I/O is not required for each query, thereby greatly reducing the disk I/O operation, reducing the delay, improving the search speed and the search efficiency, and realizing the effect of immediate response.
In a possible implementation manner, in step S13, when determining the writing mode, the current available memory resources of the server 20 may also be considered, so as to avoid a crash due to an excessive memory usage rate. Specifically, in step S23, the current memory usage rate of the server 20 may be obtained, and if the memory usage rate is greater than or equal to a preset crash threshold, it is determined that the reading mode is one by one. If the memory usage is smaller than the preset collapse threshold, determining a reading mode according to the number of the IP addresses.
Meanwhile, when the reading mode is batch reading, the residual memory can be calculated according to the current memory utilization rate, and the mapping threshold value can be calculated according to the residual memory. And dividing the index segments between the starting index and the ending index according to the mapping threshold value to obtain a plurality of mapping segments. In this way, the memory mapping file technology is adopted, and the additional information in the storage area corresponding to each mapping segment is mapped to the memory in a mode of mapping one mapping segment at a time, so that the query file is obtained in the memory, after the search of the query file is finished, the query file is deleted, and then the additional information in the storage area corresponding to the next mapping segment is mapped to the memory until all the searches are finished.
By the above way, when the additional information stored in the tape is too much under the condition that the server 20 is prevented from being crashed due to too high memory usage rate, batch reading can be performed, so that the number of I/O of the access disk is reduced as much as possible, the reading speed is improved, the delay is reduced, and the data management efficiency is improved.
According to the information management method, the storage area for storing the additional information of the IP address in the file can be directly positioned according to the management index after the IP address is converted into the integer, the IP address is not required to be stored, the storage and reading processes can be greatly simplified, and the complexity of the system and the dependence on a database are reduced. Meanwhile, when the number of the IP addresses to be stored and read is large, a mode of batch writing and batch reading is adopted, so that the disk I/O operation is reduced as much as possible, the speed is increased, the delay is reduced, the instantaneity and the instantaneity of data retrieval are improved, and the efficiency of data management is improved.
Based on the same concept as the above-described information management method, in one possible embodiment, the present application also provides an information management apparatus 30, which information management apparatus 30 can be applied to the server 20 in fig. 1. Referring to fig. 6, the information management apparatus 30 may include a data acquisition module 301, a mode determination module 302, a conversion module 303, and a writing module 304.
The data obtaining module 301 is configured to receive a storage request, and obtain additional information to be stored and an IP address corresponding to the additional information.
The mode determining module 302 is configured to determine a writing mode according to the number of IP addresses.
The conversion module 303 is configured to convert the IP address into an integer for each IP address, and use the integer as a management index of additional information of the IP address. Wherein each additional information corresponds to a unique management index.
The writing module 304 is configured to write each additional information into a storage area corresponding to a management index of the additional information in the management file according to the writing mode.
Further, a reading module may be further included.
The data obtaining module 301 is further configured to obtain a search request, and parse an IP address in the search request.
The mode determining module 302 is further configured to determine a reading mode according to the number of IP addresses in the search request.
The conversion module 303 is further configured to convert each IP address in the search request into an integer form of management index.
And the reading module is also used for reading the additional information of each IP address in the retrieval request from the management file according to the reading mode and the management index to generate a retrieval result.
The information management device 30 can store additional information of the IP address in a storage area corresponding to the management index by the cooperation of the data acquisition module 301, the mode determination module 302, the conversion module 303, and the writing module 304 without storing the IP address and the index, and converting the IP address into an integer as the management index. The storage flow is greatly simplified, and the storage complexity is reduced, so that the speed of data storage can be improved, and the high efficiency of data management is improved.
The specific limitation regarding the information management apparatus 30 may be referred to the limitation regarding the information management method hereinabove, and will not be repeated here. The respective modules in the above-described information management apparatus 30 may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or independent of a processor in the electronic device, or may be stored in software in a memory of the electronic device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a server 20 is provided, the internal structure of which may be as shown in FIG. 7. The server 20 includes a processor, memory, communication interfaces, and input devices connected by a system bus. Wherein the processor of the server 20 is adapted to provide computing and control capabilities. The memory of the server 20 includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the server 20 is used for performing wired or wireless communication with an external terminal, where the wireless communication may be implemented through WIFI, an operator network, near Field Communication (NFC), or other technologies. The computer program, when executed by a processor, implements the information management method provided in the above embodiment.
The architecture shown in fig. 7 is merely a block diagram of a portion of the architecture associated with the inventive arrangements and is not limiting as to the server 20 to which the inventive arrangements are applied, and a particular server 20 may include more or fewer components than shown in fig. 7, or may combine certain components, or have a different arrangement of components.
In one embodiment, the information management apparatus 30 applied to the deployed device provided by the present invention may be implemented in the form of a computer program that can be run on the server 20 as shown in fig. 7. The memory of the server 20 may store therein various program modules constituting the information management apparatus 30, such as a data acquisition module 301, a mode determination module 302, a conversion module 303, and a writing module 304 shown in fig. 6. The computer program constituted by the respective program modules causes the processor to execute the steps in the information management method described in the present specification.
For example, the server 20 shown in fig. 7 may perform step S11 by the data acquisition module 301 in the information management apparatus 30 shown in fig. 6. The server 20 may perform step S13 through the mode determination module 302. The server 20 may perform step S15 through the job conversion module 303. The server 20 may perform step S17 through the writing module 304.
In one embodiment, a server 20 is provided, comprising: a processor and a memory for storing one or more programs; when one or more programs are executed by a processor, the following steps are implemented: receiving a storage request to obtain additional information to be stored and an IP address corresponding to the additional information; determining a writing mode according to the number of the IP addresses; converting the IP address into an integer for each IP address, and taking the integer as a management index of the additional information of the IP address; and writing each piece of additional information into a storage area corresponding to the management index of the additional information in the management file according to the writing mode.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of: receiving a storage request to obtain additional information to be stored and an IP address corresponding to the additional information; determining a writing mode according to the number of the IP addresses; converting the IP address into an integer for each IP address, and taking the integer as a management index of the additional information of the IP address; and writing each piece of additional information into a storage area corresponding to the management index of the additional information in the management file according to the writing mode.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus embodiments described above are merely illustrative, for example, of the flowcharts and block diagrams in the figures that illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. An information management method, applied to a server, comprising:
Receiving a storage request to obtain additional information to be stored and an IP address corresponding to the additional information;
determining a writing mode according to the number of the IP addresses;
Converting the IP address into an integer for each IP address, and taking the integer as a management index of additional information of the IP address;
And writing each piece of additional information into a storage area corresponding to the management index of the additional information in the management file according to the writing mode.
2. The information management method according to claim 1, characterized in that the method further comprises:
Acquiring a search request and analyzing an IP address in the search request;
determining a reading mode according to the number of IP addresses in the search request;
Converting each IP address in the search request into an integer form of management index;
and reading the additional information of each IP address in the search request from the management file according to the reading mode and the management index, and generating a search result.
3. The information management method according to claim 2, wherein the server includes a disk and a memory, the disk including a management file;
the step of reading the additional information of each IP address in the search request from the management file according to the reading mode and the management index, and generating a search result includes:
When the reading mode is batch reading, sequencing all the IP addresses analyzed from the retrieval request to obtain a starting address and a terminating address;
Taking an index section between a start index corresponding to the start address and a stop index corresponding to the stop address as a mapping section;
Mapping the additional information in the storage area corresponding to the mapping section in the management file to the memory to obtain a query file in the memory;
and obtaining a search result from the query file according to the management indexes of all IP addresses in the search request.
4. The information management method according to any one of claims 1 to 3, wherein the server includes a disk including a management file and a memory;
The step of writing each additional information into the storage area corresponding to the management index of the additional information in the management file according to the writing mode includes:
when the writing mode is batch writing, dividing all additional information to be stored into at least one batch writing group;
and for each batch writing group, loading all additional information of the batch writing group to the memory, accessing the disk, and writing the additional information in the memory into a storage area corresponding to a management index of the additional information in the management file at one time.
5. The information management method according to claim 1 or 2, wherein the step of writing each of the additional information into a storage area corresponding to a management index of the additional information in the management file according to the writing pattern includes:
when the writing mode is one by one writing, writing the additional information one by one into a storage area corresponding to a management index of the additional information in the management file.
6. The information management method according to claim 2, wherein the step of reading additional information of each IP address in the search request from the management file in accordance with the read mode and the management index, and generating a search result, comprises:
and when the reading mode is one by one reading, reading the additional information in the storage area corresponding to each management index from the management file one by one to obtain a retrieval result.
7. The information management method according to claim 1 or 2, wherein the step of determining a writing pattern according to the number of the IP addresses includes:
judging whether the number of the IP addresses exceeds a preset batch threshold value or not;
If yes, determining the writing mode as batch writing;
If not, determining the writing mode as writing one by one.
8. The information management method according to claim 2, wherein the step of determining a read mode based on the number of IP addresses in the search request includes:
judging whether the number of the IP addresses in the search request exceeds a preset batch threshold value or not;
If yes, determining that the reading mode is batch reading;
if not, determining the reading mode as reading one by one.
9. An information management device is characterized by being applied to a server, and comprises a data acquisition module, a mode determination module, a conversion module and a writing module;
The data acquisition module is used for receiving a storage request and obtaining additional information to be stored and an IP address corresponding to the additional information;
The mode determining module is used for determining a writing mode according to the number of the IP addresses;
the conversion module is used for converting the IP address into an integer for each IP address and taking the integer as a management index of the additional information of the IP address;
and the writing module is used for writing each piece of additional information into a storage area corresponding to the management index of the additional information in the management file according to the writing mode.
10. A server comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executable instructions to implement the information management method of any one of claims 1 to 8.
CN202410208429.3A 2024-02-26 Information management method, device and server Pending CN117971127A (en)

Publications (1)

Publication Number Publication Date
CN117971127A true CN117971127A (en) 2024-05-03

Family

ID=

Similar Documents

Publication Publication Date Title
CN107092439B (en) Data storage method and equipment
KR101994021B1 (en) File manipulation method and apparatus
CN108205577B (en) Array construction method, array query method, device and electronic equipment
US10649905B2 (en) Method and apparatus for storing data
CN109885577B (en) Data processing method, device, terminal and storage medium
CN111813805A (en) Data processing method and device
CN115470156A (en) RDMA-based memory use method, system, electronic device and storage medium
CN111803917A (en) Resource processing method and device
CN115114232A (en) Method, device and medium for enumerating historical version objects
CN114925041A (en) Data query method and device
CN107423425B (en) Method for quickly storing and inquiring data in K/V format
CN110222046B (en) List data processing method, device, server and storage medium
CN116340198B (en) Data writing method and device of solid state disk and solid state disk
CN117971127A (en) Information management method, device and server
CN108073709B (en) Data recording operation method, device, equipment and storage medium
CN107977381B (en) Data configuration method, index management method, related device and computing equipment
CN113132241B (en) ACL template dynamic configuration method and device
CN111310088B (en) Page rendering method and device
CN114238264A (en) Data processing method, data processing device, computer equipment and storage medium
CN115712581A (en) Data access method, storage system and storage node
CN109358811B (en) Storage device management method and device and readable storage medium
CN108073712B (en) Method and device for deleting main data in information system and computer equipment
CN111125425A (en) Method, system and device for reading and writing video data and readable storage medium
CN112948376B (en) IP geographical position information query method, terminal equipment and storage medium
CN110740099B (en) Data flow control method and device

Legal Events

Date Code Title Description
PB01 Publication