Business data management method and system

By defining the business data structure on the communication device and adding annotations, generating a model, disabling the SWAP partition, and dynamically adjusting the storage location, the problems of resource waste and poor performance of communication equipment in different scenarios are solved, and efficient data management and recovery are achieved.

CN116578565BActive Publication Date: 2025-09-26FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310547995.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-12
Publication Date
2025-09-26
Estimated Expiration
2043-05-12

AI Technical Summary

Technical Problem

In the prior art, communication equipment needs to write a large amount of code for different business data structures in different scenarios, resulting in waste of hardware resources and poor performance, and it is difficult to automatically restore hard disk data to the memory data structure.

Method used

By adding comments in the programming language to define the business data structure, generate a business data model, dynamically adjust the storage location according to the data importance and scenario, disable the SWAP partition of the Linux system, and use the script language to parse and generate preset format files to achieve automatic movement and backup of business data between memory and hard disk.

Benefits of technology

It reduces the amount of code to be written, improves business processing performance, avoids waste of hardware resources, and achieves efficient data management and recovery under limited resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116578565B_ABST
    Figure CN116578565B_ABST
Patent Text Reader

Abstract

This application relates to a business data management method and system, and relates to the field of communications technology. The method includes: disabling SWAP partitions on Linux-based network devices; defining business data structures and adding annotations using a programming language, and then parsing and generating a business data model. The annotations are used to reflect the importance of the business data and the processing strategies for different scenarios; the network device reads the business data model and dynamically adjusts the storage location of the business data based on its importance; and the business data is moved between memory and hard disk according to the corresponding processing strategies for different scenarios. This application can avoid writing a large amount of code and improve business processing performance under limited resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and more specifically to a service data management method and system. Background Art

[0002] To complete various network functions, communication devices store data in the device's memory and hard disk. For example, after completing BGP route learning, the BGP protocol (Border Gateway Protocol) stores routing table entry data in the memory. After receiving the configuration issued by the network management, the ACL (Access Control Lists) module generates the ACL table entry data required by the chip. After completing IP address allocation, the DHCP (Dynamic Host Configuration Protocol) module stores the allocation data. These data are collectively referred to as business data.

[0003] Business data is generally stored in common data structures (such as trees, arrays, and linked lists) and stored in the RAM (Random Access Memory) of communication devices.

[0004] During operation, communication equipment will process service data differently according to different scenarios. For example,

[0005] 1. If the device needs to be restarted for various reasons, and you want to be able to directly restore business data after the restart, you need to save the business data to the hard disk before restarting.

[0006] 2. To ensure reliability, the device is designed with two main control boards (main and backup) for redundancy. In this scenario, business data must be backed up from the main control board to the backup board. Each business module on the device must write backup code to send business data to the backup board's RAM via messages.

[0007] 3. To ensure uninterrupted network services, when upgrading the software version, first save the data to the database by calling the database write interface. After the upgrade is successful, the business module restores the data to RAM through the database read interface.

[0008] The existing business data management methods have the following problems:

[0009] (1) The business module needs to perceive the above-mentioned different scenario events to process data transmission, backup, and recovery. Since the data structures of each business are different, a large amount of different code needs to be written for different data structures. Although database technology can be used to store data persistently, simplifying the complexity of implementing storage on the hard disk, it is still impossible to automatically restore the data stored on the hard disk to the business-customized in-memory data structure.

[0010] (2) Since the services running on communication equipment are fixed and the specifications of each service are pre-designed, if the hardware memory is designed according to the maximum specifications of each business scenario, the hardware cost will be greatly increased, and hardware resources are limited. The actual equipment will not use all scenarios during operation, and it is not possible to run all scenarios to the maximum specifications, which results in a waste of hardware resources. If the designed hardware memory is too small, on a communication device based on the Linux operating system, when the operating system finds that the system memory is insufficient, it will save the data that is not frequently accessed in the memory to the swap partition (swap partition). This process does not identify the importance of the business and may save important business data to the hard disk, reducing the real-time performance of important business processing. Summary of the Invention

[0011] The embodiments of the present application provide a business data management method and system, which can avoid writing a large amount of code and improve business processing performance under limited resources.

[0012] In a first aspect, a business data management method is provided, comprising the steps of:

[0013] Disable SWAP partitions on Linux-based network devices;

[0014] After defining the business data structure and adding annotations using a programming language, the business data model is parsed and generated. The annotations are used to reflect the importance of the business data and the processing strategies for different scenarios.

[0015] The network device reads the business data model and dynamically adjusts the storage location of the business data based on its importance; it moves the business data between the memory and the hard disk according to the processing strategies corresponding to different scenarios.

[0016] In some embodiments, the annotation uses specific keywords to describe the name, data type, priority, whether it supports non-interruption service upgrade, whether it supports master / slave mode, and whether it supports power failure recovery of the service data.

[0017] In some embodiments, the annotated business data is parsed using a scripting language, and the preset format file generated after parsing is placed on the network device together with the application of the network device. When the network device is powered on, the content of the preset format file is read to generate a business data model.

[0018] In some embodiments, business data is moved between memory and hard disk according to processing strategies corresponding to different scenarios, including moving business data from memory to hard disk: locking the business data to be accessed in memory, traversing and accessing it according to the data type defined by the business data model, and writing the read business data of the data type that needs to be moved into the hard disk database, or writing it into the hard disk according to the custom data type; releasing the original business data in memory, marking the corresponding business data on the hard disk, and releasing the data lock.

[0019] In some embodiments, business data is moved between memory and hard disk according to processing strategies corresponding to different scenarios, including moving business data from hard disk to memory: locking the business data to be accessed in the hard disk, reading the business data to be accessed from the hard disk, obtaining the location corresponding to the business data according to the data type defined by the business data model, and restoring the read business data to the business data in memory.

[0020] In some embodiments, the storage location of business data is dynamically adjusted based on the importance of the business data, including scheduling business data based on importance when memory is insufficient:

[0021] Based on the data type of each field in the business model, calculate the memory usage of each single business data item, and obtain the number of business data items based on the addition and deletion records of business data items;

[0022] Reserve some memory and periodically obtain the remaining memory space of the network device occupied by business data. If the remaining memory space is less than the reserved memory, move the less important business data to the hard disk.

[0023] In some embodiments, the importance is represented by a weight value, which is determined based on the priority of the business data and the number of accesses per unit time. Business data with a smaller weight value is moved to the hard disk first.

[0024] In some embodiments, when a network device is plugged into a standby control board, the data type that needs to be backed up is searched to find the service data that needs to be backed up on the active control board;

[0025] If the business data is in the memory of the active control board, traverse and access it according to the data type, and write the read business data of the data type that needs to be backed up into the memory of the standby control board;

[0026] If the business data is in the hard disk of the active control board, traversal access is performed according to the data type, the business data is read from the hard disk, and the read business data of the data type is written to the hard disk of the standby control board.

[0027] In some embodiments, when a service needs to be upgraded without interrupting the service, the service data that needs to be backed up for the upgrade scenario without interrupting the service is searched from the memory, the read service data is written to the hard disk database, and the service data in the original memory is released;

[0028] After the non-interruption service upgrade, the backed-up service data of the non-interruption service upgrade service scenario is read from the hard disk, and the read service data is restored to the memory according to the location of the corresponding data type.

[0029] In a second aspect, a business data management system based on any of the above methods is provided, comprising:

[0030] Network function processing module, used to complete network functions on network devices;

[0031] The business data model is a model generated by defining the business data structure in a programming language and adding annotations, and then parsing it;

[0032] The business data proxy module is provided in the network function processing module and is used to obtain business data from the business data service module and provide an access interface for the business data;

[0033] The business data service module is set up in the network device and is used to parse and load the business data model, read the business data model and store it, perceive different scenarios and send it to the business data agent module; dynamically adjust the storage location of the business data according to the importance of the business data; and move the business data between the memory and the hard disk according to the processing strategies corresponding to different scenarios.

[0034] The beneficial effects of the technical solution provided by this application include:

[0035] This application disables the swap partition of the Linux operating system, defines the business data structure and adds annotations through the programming language, and parses and generates a business data model. Since annotations can be used to reflect the importance of business data and the processing strategies for different scenarios, after the business data is stored, the business data can be automatically moved or copied according to different scenarios, avoiding the need to write a large amount of different code based on different data structures; compared to using database technology for persistent data storage, business data in the hard disk can be automatically restored to the memory.

[0036] The annotations in this application are used to reflect the importance of business data. When the memory is insufficient, the Linux operating system will no longer exchange business data between the memory and the hard disk. Instead, the business data storage location will be dynamically adjusted according to the importance of the business, and the business data with the lowest importance will be handed over to the hard disk. Compared with the fixed selection of a certain memory structure or database, a more flexible business data scheduling and management method is provided. The scheduling algorithm is more suitable for embedded devices. Under limited resource conditions, there is no need to increase hardware costs, and it can improve the daily business processing performance of network equipment. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0038] Figure 1 This is a flow chart of a business data management method according to an embodiment of the present invention;

[0039] Figure 2 Add a business data flow diagram for the embodiment of the present invention;

[0040] Figure 3 Schematic diagram of a business data management system according to an embodiment of the present invention.

[0041] Reference numerals:

[0042] 1. Network function processing module; 2. Business data model; 3. Business data service module; 4. Business data proxy module. DETAILED DESCRIPTION

[0043] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0044] The embodiment of the present application provides a business data management method, which can solve the problem of the existing technology center writing a large number of different codes according to different data, and can also solve the problem of how to improve business processing performance under limited hardware costs.

[0045] like Figure 1 As shown, an embodiment of a business data management method is provided, comprising the steps of:

[0046] S1. Disable the swap partition on Linux-based network devices.

[0047] S2. Define the business data structure using a programming language and add annotations. Then, use a scripting language to automatically parse the annotated code to generate a business data model. The annotations are used to reflect the importance of the business data and the processing strategies for different scenarios. In this embodiment, the programming language may be C. In other embodiments, the programming language may also be C++, Go, or other languages.

[0048] S3. The network device reads the business data model and dynamically adjusts the storage location of the business data based on its importance. It also moves the business data between the memory and the hard disk based on the processing strategies corresponding to different scenarios.

[0049] In step S2, specific keywords are added to the annotation to describe attributes such as the name, data type, priority, support for In-Service Software Upgrade (ISSU), support for active / standby mode, and support for power failure recovery. In this embodiment, the priority level can be used to reflect the importance of the service data, while attributes such as support for ISSU, active / standby mode, and support for power failure recovery can be used to reflect the processing strategies for the service data in different scenarios. The annotated service data is parsed using a scripting language. When parsing the service data, the scripting language can extract the importance of the service data, how to back it up, and how to save it to a database or file based on the annotation content.

[0050] The parsed, pre-formatted file is placed on the network device along with the network device's application. When the network device is powered on, it reads the pre-formatted file to generate the service data model. The scripting language can be Python or other technologies that parse code to extract information. The parsed, pre-formatted file can be in a format such as JSON, XML, or INI.

[0051] Following the above steps, the common business data interface structures are modified and embedded with business data scheduling and management logic. During normal operations, business data is read and written directly to memory through these interfaces. When needed, business data can be moved to the hard disk or copied to a backup control board. When business data needs to be restored from the hard disk, it can be automatically read from the hard disk and restored to the common data structure.

[0052] Each of the above business data models corresponds to a data type. During operation, the network device saves the location of the current data type. Each business model will have multiple data entries during actual operation.

[0053] like Figure 2 The following figure shows the process of adding a business data entry at runtime. The steps are as follows:

[0054] A1 adds a business data entry.

[0055] A2 determines whether the data type of the currently added business data item is stored in the memory. If so, the process proceeds to A3; if not, the process proceeds to A4.

[0056] A3 saves the business data entry in the user-specified memory data structure and ends.

[0057] A4 saves the business data entry to the hard disk and ends.

[0058] Similarly, when a business data entry needs to be deleted or modified during runtime, it is determined whether the data type of the business data entry to be modified is stored in the memory. If so, the corresponding business data entry is modified in the memory; if not, the business data entry is modified on the hard disk.

[0059] When querying business data, determine whether the business data type of the business data item to be queried is stored in the memory. If so, call out the business data item in the memory; if not, call out the business data item in the hard disk.

[0060] In the above step S3, the business data is moved between the memory and the hard disk according to the processing strategies corresponding to different scenarios, including moving the business data from the memory to the hard disk and moving the business data from the hard disk to the memory.

[0061] When business data needs to be moved from memory to the hard disk, the business data to be accessed in the memory is locked, and traversal access is performed according to the data type defined by the business data model. The business data of the data type that needs to be moved is read and written to the hard disk database through the database interface, or the data type to be written is defined by the user and written to the hard disk according to the data type. After the writing is completed, the corresponding business data in the original memory is released, and the corresponding business data is marked as currently on the hard disk, releasing the data lock. When the business data is accessed again, because the corresponding business data has been marked on the hard disk, all read and write operations are on the hard disk. When business data is moved in this application, it can be to move one business data entry or to move multiple business data entries.

[0062] When the network device is powered on or the system memory is sufficient, when the business data on the hard disk needs to be moved to the memory, the business data to be accessed in the hard disk is locked, the business data to be accessed is read from the hard disk, and the corresponding location of the business data is obtained according to the data type defined in the business data model, and the read business data is restored to the business data in the memory.

[0063] In some embodiments, the network device originally has only one active control board. When a standby control board is inserted, step S3 also includes backing up the service data on the active control board to the standby control board. The data type that requires active / standby backup is searched based on the service data model, and the service data to be backed up is found on the active control board. If the service data is in the memory of the active control board, a traversal access is performed based on the data type, and the service data of the data type is written to the memory of the standby control board. If the service data is in the hard disk of the active control board, a traversal access is performed based on the data type, and the service data of the data type is read from the hard disk, and the service data of the data type is written to the hard disk of the standby control board.

[0064] In some embodiments, step S3 also includes a service processing strategy for an ISSU scenario. When an ISSU is required for a service, the service data requiring ISSU backup is searched for in memory based on the data type. The retrieved service data is written to the hard disk database, freeing the original service data in memory. After the ISSU, the backup service data for the ISSU service scenario is read from the hard disk and restored to memory based on the location of the corresponding data type.

[0065] In the above step S3, the memory occupancy of the network device can be obtained through the Linux system interface, and the network device can dynamically adjust the storage location of the business data according to the importance of the business data. According to the data type of each field in the business model, the memory occupancy of each individual business data item can be calculated, and the number of business data items can be obtained according to the addition and deletion records of the business data items. In order to cope with sudden memory requests, some memory is reserved for the network device in advance. In this embodiment, 10% of the memory is reserved, which is about 300MB. The remaining memory space occupied by the business data in the network device is periodically obtained, and the occupancy of each business data is mentioned. If the remaining memory space is less than the reserved memory, the scheduling of the business data is triggered, and the business data with low importance is moved to the hard disk. In this embodiment, the period can be set to 1 minute.

[0066] In some embodiments, importance can be represented by a weight value, which can be calculated in a variety of ways and adjusted according to system needs. In this embodiment, the weight value is determined based on the priority of the business data and the number of accesses per unit time, and business data with a smaller weight value is moved to the hard disk first. For example, if a business data has a priority of X and a number of accesses in the last minute of Y, the weight value can be calculated using the formula 100*X+Y, and the business data with the smallest weight value is moved to the hard disk first.

[0067] Assume that the system currently runs four services and contains five types of service data: Service 1 data A, Service 2 data B, Service 3 data C, Service 4 data D, and Service 4 data E. At a certain moment, the system has 240MB of remaining memory, which is less than the reserved 300MB. The memory situation is shown in Table 1.

[0068] Table 1

[0069]

[0070] The weight values ​​calculated by the above formula 100*X+Y are shown in Table 2.

[0071] Table 2

[0072] Business data Weight value Business 1 Data A 300 Business 2 Data B 9030 Business 3 Data C 250 Business 4 Data D 10040 Business 4 Data E 160

[0073] As can be seen, the service data is ranked from highest to lowest by weight: D > B > A > C > E. Therefore, service 4 data E is first moved from memory to the hard disk. After adjustment, the remaining memory space is 290MB, which is still less than the reserved 300MB of memory. Then, service 3 data C is moved from memory to the hard disk. After adjustment, the remaining memory space is 340MB, which is greater than the reserved 300MB of memory. This service data scheduling triggered by insufficient system memory ends.

[0074] like Figure 3 As shown, an embodiment of a business data management system is provided, which can be used to implement the above method embodiment. The business data management system includes a network function processing module 1, a business data model 2, a business data service module 3, and a business data proxy module 4.

[0075] The network function processing module 1 is used to complete network functions on the network device, such as processing the system, BGP protocol, and DHCP protocol. In addition, the SWAP partition has been closed on the network device based on the Linux system.

[0076] Business data model 2 is generated by defining the business data structure and adding annotations in a programming language. This annotation is then parsed by a scripting tool to generate the annotated source code. This model can be in formats such as JSON, XML, or INI. The annotations reflect the importance of the business data and the processing strategies for different scenarios. Programming languages ​​such as C, C++, and Go can be used.

[0077] The business data proxy module 4 is provided in the network function processing module 1 and is used to obtain business data from the business data service module 3 and provide an access interface for the business data.

[0078] Service data service module 3, provided in the network device, is responsible for parsing and loading service data model 2, reading and storing service data model 2, obtaining management information about service data, and sensing different scenarios, such as ISSU, device power-on recovery, and backplane insertion, and sending this information to service data proxy module 4. Service data service module 3 can also send service data stored in service data service module 3 to service data proxy module 4.

[0079] Furthermore, the business data management system may also include relevant modules of the standby control board, that is, a backup module of the module on the main control board is provided on the standby control board.

[0080] During operation, the business data service module 3 loads the business data model 2. The network function processing module 1 uses the data access interface provided by the business data proxy module 4 to add, delete, modify, and query business data items. The business data management system schedules and manages business data items based on factors such as the remaining memory space of network devices and the presence of spare control boards. Business data can be stored in memory or on the hard disk, depending on the business.

[0081] In this embodiment, service data model 2 defines the service data structure using C language. For example, the service data structure defined below stores address allocation information for the DHCP server. Specifically, it contains two pieces of information: interface index information (field named if_index) and allocated IP address information (field named ipaddr).

[0082]

[0083] By adding specific keywords to comments to describe attributes such as the service data's name, priority, support for ISSU, support for active / standby mode, and support for power-failure recovery, the scripting language can extract information about the service data's importance, how to back it up, or how to save it to a database or file from the comments when parsing the service data structure definition.

[0084] For example, the format of the comment is:

[0085] @Annotation function keyword (annotation field = "field value", ...., there can be multiple annotation fields)

[0086] The specific content definition of the annotation can be referred to Table 1, and annotation keywords and annotation fields can be added according to actual needs.

[0087] Table 3

[0088]

[0089]

[0090] The Entity annotation indicates that this data structure is a business data table item and uses the default business data parsing rules: the structure name corresponds to the table name in the business data table, and the structure member names correspond to the field names in the table. The Column annotation can be omitted, in which case the script parser will use the default value. Column metadata defines all properties of the column mapped to the business data table: column name, uniqueness, and default value.

[0091] Modify the business data annotations according to the business data annotation rules listed above.

[0092]

[0093] In the example above, there are two kinds of comments:

[0094] 1. Provide overall annotations for the structure, mainly describing the attributes of the entire business data.

[0095] @Entity(service="dhcp",

[0096] "name="dhcp4bind",level="10",issu="false",slave="true",persistence="true") indicates that this service data belongs to the DHCP service, has the service data name of dhcp4bind, has a service priority of 10, does not require support for issu upgrades, must support active / standby backup, and must support data recovery after device restart. If Ramtype is not defined, the default is used, indicating that the data is organized in a red-black tree in memory.

[0097] 2. Annotate the structure members, mainly to describe the attributes of the specific content in the business data.

[0098] @Column(name="ifindex",unique="true") means the if_index of this business data. When data is transmitted or persisted to a hard disk text file or database file, the field name is ifindex, and this field value is unique and can be used as a key value.

[0099] In the above example, ipaddr is not commented, which means that the field name is unchanged, the data type is unsigned int, the field value is non-unique, and it is not used as a key value.

[0100] After defining and annotating the business data, perform syntactic and semantic parsing of the definition using a scripting language, such as Python. Since the technology for parsing script code and extracting information is relatively mature, the specific parsing techniques involved will not be discussed in detail here.

[0101] After the script extracts the business data information, it generates a file in the specified format such as JSON, XML, or INI. In this embodiment, a JSON file is generated, and the specific format is designed specifically for business data. The specific definitions are as follows, and fields can be added or deleted according to actual needs:

[0102]

[0103]

[0104] After the script parses the annotated DHCP4_BIND structure definition source code, it generates the following JSON content:

[0105]

[0106] This completes the coding and related processes for Business Data Model 2. It's important to note that the JSON content is largely identical to the previously mentioned comments. The comments need to be parsed into JSON format using a script because this format, designed specifically for business data, is easier for applications on communication devices to load and parse. Comments are written first rather than directly in JSON because, compared to JSON, comments are easier for business model developers to master and write. Furthermore, information about numerous fields in JSON can be automatically generated by scripts parsing the C source code, reducing the workload for developers writing JSON.

[0107] The business data management system obtains business data information through a JSON file, places the JSON file generated by script parsing and the application of the network device on the network device, and when the network device is powered on and started, the business data management system reads the content of the JSON file after startup, places the read business data model 2 into a tree structure, and sends this information to the business data proxy module 4 through an inter-process communication message.

[0108] When the network device moves service data from the hard disk to the memory, it locks the service data to be accessed, reads the service data from the hard disk, and restores the service data to the data type in the memory according to the data type defined by the service data model 2. Because the service data management system stores the type of the service data in the memory data structure, the data can be restored to the required data structure without the involvement of the network function processing module 1 during the data restoration process.

[0109] For example, the data type of the memory data structure defined in JSON for dhcp4bind is a red-black tree. When restoring data, the service data management system uses the red-black tree data type interface to store the acquired service data in memory, forming a red-black tree. After the read and restore operation is complete, the hard disk data lock is released, and the DHCP service can access the dhcp4bind data in memory.

[0110] This application defines the business data model through C language annotations. After the business data is stored in the business data management system, it will automatically move or copy the business data according to different scenarios, reducing the amount of functional coding of network equipment.

[0111] Dynamically adjust the business data storage location according to the importance of the business. Compared with the fixed selection of a certain memory structure or database, it provides a more flexible business data scheduling and management method. The scheduling algorithm is more suitable for embedded devices and can effectively improve the daily operation performance of the equipment under limited resources.

[0112] It should be noted that, in this application, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0113] The foregoing is merely a list of specific embodiments of the present application, intended to enable those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the broadest scope consistent with the principles and novel features of the present application.

Claims

1. A business data management method, characterized in that: Including steps: Disable SWAP partitions on Linux-based network devices; After defining the business data structure and adding annotations using a programming language, the business data model is parsed and generated. The annotations are used to reflect the importance of the business data and the processing strategies for different scenarios. The network device reads the business data model and dynamically adjusts the storage location of the business data based on its importance; Move business data between memory and hard disk based on the processing strategies corresponding to different scenarios; According to the processing strategies corresponding to different scenarios, business data is moved between memory and hard disk, including moving business data from hard disk to memory: locking the business data to be accessed on the hard disk, reading the business data to be accessed from the hard disk, obtaining the corresponding location of the business data based on the data type defined by the business data model, and restoring the read business data to the business data in memory.

2. The business data management method according to claim 1, wherein: The annotation uses specific keywords to describe the name, data type, priority, whether it supports non-interruption service upgrade, whether it supports master-slave mode, and whether it supports power failure recovery of the service data.

3. The business data management method according to claim 1, wherein: The annotated business data is parsed using a scripting language, and the preset format file generated after parsing is placed on the network device together with the application of the network device. When the network device is powered on, the content of the preset format file is read to generate a business data model.

4. The business data management method according to claim 1, wherein: According to the corresponding processing strategies for different scenarios, business data is moved between memory and hard disk, including moving business data from memory to hard disk: locking the business data to be accessed in memory, traversing and accessing it according to the data type defined by the business data model, and writing the read business data of the data type that needs to be moved to the hard disk database, or writing it to the hard disk according to the custom data type; releasing the original business data in memory, marking the corresponding business data on the hard disk, and releasing the data lock.

5. The business data management method according to claim 1, wherein: Dynamically adjust the storage location of business data based on its importance, including scheduling business data by importance when memory is insufficient: Based on the data type of each field in the business model, calculate the memory usage of each single business data item, and obtain the number of business data items based on the addition and deletion records of business data items; Reserve some memory and periodically obtain the remaining memory space of the network device occupied by business data. If the remaining memory space is less than the reserved memory, move the less important business data to the hard disk.

6. The business data management method according to claim 5, wherein: The importance is represented by a weight value, which is determined based on the priority of the business data and the number of accesses per unit time. Business data with a small weight value is preferentially moved to the hard disk.

7. The business data management method according to claim 1, wherein: When a network device is inserted into a standby control board, it searches for the type of data that needs to be backed up and finds the business data that needs to be backed up on the active control board; If the business data is in the memory of the active control board, traverse and access it according to the data type, and write the read business data of the data type that needs to be backed up into the memory of the standby control board; If the business data is in the hard disk of the active control board, traversal access is performed according to the data type, the business data is read from the hard disk, and the read business data of the data type is written to the hard disk of the standby control board.

8. The business data management method according to claim 1, wherein: When a business upgrade is required without service interruption, the business data that needs to be backed up for the upgrade scenario is searched from the memory, and the read business data is written to the hard disk database, releasing the original business data in the memory; After the non-interruption service upgrade, the backed-up service data of the non-interruption service upgrade service scenario is read from the hard disk, and the read service data is restored to the memory according to the location of the corresponding data type.

9. A business data management system based on the method according to any one of claims 1 to 8, characterized in that: include: Network function processing module, used to complete network functions on network devices; The business data model is a model generated by defining the business data structure in a programming language and adding annotations, and then parsing it; The business data proxy module is provided in the network function processing module and is used to obtain business data from the business data service module and provide an access interface for the business data; The business data service module is set up in the network device and is used to parse and load the business data model, read the business data model and store it, perceive different scenarios and send it to the business data agent module; dynamically adjust the storage location of the business data according to the importance of the business data; and move the business data between the memory and the hard disk according to the processing strategies corresponding to different scenarios.

Citation Information

Patent Citations

  • Automatically assigning data protection policies using anonymized analytics

    US20230052851A1