Data processing method, device, equipment and program product
By introducing data cache modules and database proxy modules into the network system, the performance reduction problem when the network system is coupled to the database is solved, more efficient data management and consistency guarantee are achieved, and the overall management of multiple devices is supported.
Patent Information
- Application Number
- CN202411818346.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-01
AI Technical Summary
When existing network systems are coupled with databases, frequent data exchanges reduce service performance and cannot effectively manage multiple devices as a whole.
Using the data processing method, the device data is cached through the data cache module. The database proxy module determines the permissions for data processing requests based on the device role information and storage path, and interacts with the database module when necessary to reduce the number of data exchanges and improve data consistency.
It effectively reduces the number of data exchanges, improves system performance, ensures data consistency between master and slave devices, and supports effective management of multiple devices as a whole.
Smart Images

Figure CN119739751A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data communications, and in particular to data processing methods, devices, equipment and program products. Background Art
[0002] Traditional network systems usually adopt modular coupling architecture, and each module communicates by passing data and executing methods. The modular coupling architecture concentrates most modules in the same process, which is conducive to improving the performance of a single device, but is not conducive to fault isolation and has high development and maintenance costs. In the case of stacking, as the number of stacked devices increases and the types (including box-type devices, frame-type devices, etc.) change, the logic of module synchronization data will become more and more complicated, and data synchronization is prone to cause performance bottlenecks.
[0003] With the development of network technology, a new generation of network operating systems such as SONiC has emerged. The SONiC network system uses a multi-process approach to achieve modularization and interacts between modules through a database, thereby transforming from process-oriented to data-oriented and achieving decoupling between business modules. However, when the SONiC network system is coupled with the Redis database, the read and write operation scheduling of the SONiC network system depends on the Redis database. The frequent data exchange (IO operation) between the network system and the database reduces business performance, and the network system does not support effective management of multiple devices as a whole. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a data processing method, apparatus, device and program product to solve the problem in the prior art that when the network system is coupled with data, data will frequently interact with the database, which reduces the system business performance and cannot effectively support the effective management of multiple devices as a whole.
[0005] A first aspect of an embodiment of the present application provides a data processing method, the method being applied to a master device or a slave device in a stacking system, the master device and the slave device both comprising a data cache module, a database proxy module and a database module, the data cache module being used to cache device data, the method comprising:
[0006] The data cache module obtains a data processing request and sends the data processing request to the database proxy module;
[0007] The database proxy module determines the authority of the data processing request according to the role information and storage path of the data processing device;
[0008] When the data processing request has processing authority, the database proxy module interacts with the database module according to the data processing request.
[0009] In combination with the first aspect, in a first possible implementation manner of the first aspect, the data processing request is a data preservation request;
[0010] The data cache module obtains a data processing request and sends the data processing request to the database proxy module, including:
[0011] The data cache module obtains the data saving request and writes the data to be saved into the cache;
[0012] The data cache module serializes the data to be saved by a predetermined data model description method to obtain first serialized data, and sends the first serialized data to the database proxy module;
[0013] The database proxy module interacts with the database module according to the data processing request, including:
[0014] The database proxy module deserializes the first serialized data to obtain first deserialized data;
[0015] According to the storage path obtained by parsing the data saving request, the database proxy module stores the deserialized data in the database module.
[0016] In combination with the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the database proxy module includes an event monitoring submodule, an event processing submodule, a permission management submodule, and a platform information management submodule;
[0017] The database proxy module determines the authority of the data processing request according to the role information and storage path of the data processing device, including:
[0018] After monitoring the data saving request, the event monitoring submodule sends the data saving request to the event processing submodule and the authority management submodule;
[0019] The authority management submodule obtains the role information of the current device from the platform information management submodule, and parses the uniform resource identifier of the data to be saved to obtain a storage path for saving the data, and determines the authority of the data saving request according to the role information and the storage path;
[0020] When the data processing request has processing authority, the database proxy module interacts with the database module according to the data processing request, including:
[0021] After receiving the permission confirmation information and the storage path from the permission management submodule, the event processing submodule stores the first deserialized data in the database module according to the storage path.
[0022] In combination with the first aspect, in a third possible implementation manner of the first aspect, the data processing request is a data recovery request;
[0023] When the data processing request has processing authority, the database proxy module interacts with the database module according to the data processing request, including:
[0024] The database proxy module parses the uniform resource locator corresponding to the data cache request to obtain the storage path of the data to be cached;
[0025] The database proxy module obtains the data to be cached from the database module according to the storage path;
[0026] The database proxy module performs serialization processing on the acquired data to obtain second serialized data;
[0027] The database proxy module sends the second serialized data to the data cache module, and the data cache module deserializes the second serialized data to obtain and cache second deserialized data.
[0028] In combination with the first aspect, in a fourth possible implementation manner of the first aspect, before the data cache module obtains the data processing request, the method further includes:
[0029] The database proxy module monitors the topology structure change information of the stacking system;
[0030] If the current device is a slave device, the topology change information is sent to an upper-layer device, and a data recovery request determined by the upper-layer device according to the split change information of the stacking system is received.
[0031] In combination with any one of the first aspect to the fourth possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, the master device and the slave device further include a UI module and a hardware management module;
[0032] Before the database proxy module determines the authority of the data processing request according to the role information and storage path of the data processing device, the method further includes:
[0033] receiving configuration data through the UI (User Interface) module, and sending the configuration data and the uniform resource identifier of the configuration data to the database proxy module, and / or detecting hardware event data through the hardware management module, and sending the hardware event data and the uniform resource identifier corresponding to the hardware event data to the database proxy module;
[0034] The database proxy module determines the authority of the data processing request according to the role information and / or storage path of the data processing device, including:
[0035] If the current device is a master device, the database proxy module does not restrict the write permission of any module in the master device;
[0036] If the current device is a slave device, the database proxy module determines that the module with write permission is the UI module and / or the hardware management module according to the uniform resource identifier corresponding to the configuration data and / or the hardware event data.
[0037] In combination with the fifth possible implementation manner of the first aspect, in a sixth possible implementation manner of the first aspect, the master device and the slave device further include a service module;
[0038] Before receiving configuration data through the UI module and sending the configuration data and the uniform resource identifier of the configuration data to the database proxy module, and / or detecting hardware event data through the hardware management module and sending the hardware event data and the uniform resource identifier corresponding to the hardware event data to the database proxy module, the method further includes:
[0039] The master device broadcasts a first permission range of a subscription message, and determines a second permission range of the slave device to send a subscription message;
[0040] Broadcasting a subscription message according to the first authority scope and the second authority scope;
[0041] When the data processing request has processing authority, the database proxy module interacts with the database module according to the data processing request, including:
[0042] When the data processing request has processing authority, the configuration result of the subscription message is displayed through the UI module, or the configuration corresponding to the subscription message is run through the hardware management module, or the business logic corresponding to the subscription message is run through the business module.
[0043] A second aspect of an embodiment of the present application provides a data processing device, the device being applied to a master device or a slave device in a stacking system, the master device and the slave device both comprising a data cache module, a database proxy module and a database module, the data cache module being used to cache device data, the device comprising:
[0044] A data processing request acquisition unit, configured to acquire a data processing request from the data cache module and send the data processing request to the database proxy module;
[0045] A permission determination unit, configured to determine the permission of the data processing request according to the role information and storage path of the data processing device by the database proxy module;
[0046] The database module updating unit is used for, when the data processing request has processing authority, for the database proxy module to interact with the database module according to the data processing request.
[0047] A third aspect of an embodiment of the present application provides a data processing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data processing device implements a method as described in any one of the first aspects.
[0048] A fourth aspect of the embodiments of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the method in the first aspect or its various implementations.
[0049] A fifth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in any one of the first aspects are implemented.
[0050] The sixth aspect of the embodiment of the present application provides a chip for implementing the methods in each implementation of the first aspect. Specifically, the chip includes: a processor for calling and running a computer program from a memory, so that a device equipped with the chip executes the method in the first aspect or its implementation.
[0051] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the data cache module of the master device or slave device in the stacking system of the embodiments of the present application obtains a data processing request, sends the data processing request to the database proxy module to determine the authority of the data processing request, and when the data processing request has processing authority, updates the database model according to the data processing request through the database proxy module, caches device data through the data cache module, and exchanges data with the database module through the database proxy module only when the cache misses the data, thereby effectively reducing the number of data exchanges, and determining the processing authority of the data processing request according to the role information and storage path of the data processing device through the database proxy module, thereby effectively improving the data consistency of the master device and the slave device, so that multiple devices can be effectively managed as a whole. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0053] Figure 1 It is a module schematic diagram of a master device or a slave device provided in an embodiment of the present application;
[0054] Figure 2 It is a schematic diagram of an implementation flow of a data processing method provided in an embodiment of the present application;
[0055] Figure 3 It is a business process diagram of a stacking system provided in an embodiment of the present application;
[0056] Figure 4 This is a schematic diagram of an implementation flow of a data storage method provided in an embodiment of the present application;
[0057] Figure 5 It is a schematic diagram of an implementation flow of a data recovery method provided in an embodiment of the present application;
[0058] Figure 6 It is a structural schematic diagram of a data recovery device provided in an embodiment of the present application;
[0059] Figure 7 It is a schematic diagram of a data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0061] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.
[0062] Traditional network systems are often based on modular coupling design, and each module communicates through data exchange and method calls. The modular coupling architecture concentrates most modules in the same process, which is conducive to improving the performance of a single device, but is not conducive to fault isolation and has high development and maintenance costs. In the case of stacking, as the number of stacked devices increases and the types (including box-type devices, frame-type devices, etc.) change, the logic of module synchronization data will become more and more complicated, and data synchronization is prone to cause performance bottlenecks.
[0063] With the advancement of network technology, a new generation of network operating systems such as SONiC has emerged. The SONiC system achieves modularization through multi-processes and uses databases to handle communication between modules, transforming from process-oriented to data-oriented, and achieving decoupling of business modules. However, when the SONiC system is closely integrated with databases such as the Redis database, the scheduling of its read and write operations depends on Redis, and frequent data exchanges (IO operations) affect business performance. In addition, the system also fails to support effective management of multiple devices as a unified whole.
[0064] Based on this, the embodiment of the present application proposes a data processing method: Figure 1 FIG. 1 is a schematic diagram of the module structure of the data processing device of the data processing method. Figure 1 As shown, the data processing device includes a business module, a data cache module, a database proxy module and a database module.
[0065] The business module can exchange data with the data cache module through a unified read-write interface provided by the data cache module.
[0066] The data cache module implements the read and write operations of the database module through the read and write interface. When performing a write operation, the write data will be written to the cache in the memory at the same time, and the written data will be serialized and sent to the database proxy module. When performing a read operation, the data to be read is searched in the cache. If the data to be read can be found, the data to be read is directly read out through the memory. If the data to be read cannot be found, a data read request is sent to the database proxy module. The data cache module can reduce the number of IO times that the business module accesses the database module, shield the existence of the database proxy module, thereby simplifying data access and reducing the limitations of system performance bottlenecks, which is conducive to effective support for stacking after decoupling between business modules.
[0067] The database proxy module may include an event monitoring submodule, an event processing submodule, a platform information management submodule and a permission management submodule.
[0068] Among them, the event monitoring submodule can be used to monitor the read and write requests of the upper layer (including business modules, etc.) and send the read and write requests to the event processing submodule; in addition, the monitoring submodule can monitor the changes in the data table of the database module subscribed by the upper layer, and send the acquired changes to the event processing submodule in the form of subscription messages, and can broadcast the subscription messages processed by the event processing submodule to the upper layer.
[0069] The event processing submodule can parse read and write requests and interact with the database module. It can also process subscription messages, including format conversion, serialization, etc., and return the processed subscription messages.
[0070] The platform information management submodule can be used to obtain the role information of the device and the change information of the topology structure of the stacking network.
[0071] The permission submodule is used to decide whether to process the read and write requests monitored by the event monitoring submodule according to the permission of the uniform resource identifier, and whether to broadcast the subscription messages monitored by the event monitoring submodule to the upper layer.
[0072] The database proxy module can restrict the write operations of each module of the slave device and the permissions to trigger subscriptions based on the URI, thereby ensuring the normal operation of the stacking function.
[0073] Controlling data access through the database proxy module is conducive to maintaining the consistency and security of each device in the stack system. Using URI to identify data and control access rights can be used to achieve flexible data management. By monitoring the topology changes of the stack system and processing data recovery requests, the stack system can be dynamically adjusted without the need for additional equipment, including adding devices to the stack system or splitting devices in the stack system, thereby improving the security and correctness of stack system operations.
[0074] The database module is responsible for data storage, sharing, hot backup, and master-slave synchronization, etc. It is used for interaction with modules in devices (including master devices or slave devices) and for data synchronization in the stacking system.
[0075] Figure 2 A schematic diagram of an implementation flow of a data processing method provided in an embodiment of the present application is described in detail as follows:
[0076] In S201, the data cache module obtains a data processing request and sends the data processing request to the database proxy module.
[0077] Among them, the data processing request in the embodiment of the present application may include a data save request or a data recovery request, etc. Among them, the data save request is used to save the data requested to be saved to the database module in the device (master device or slave device), such as storing the running data that the business module needs to save in the database module. The data recovery request is used to refresh and restore the data in the cache. For example, when the business module is hot restarted or hot upgraded, the occupied public resources need to be released before the business module is restarted. During the restart process, the description method registration, resource construction and data recovery of the data model are executed in sequence.
[0078] When the data cache module receives a data save request, the data cache module can write the data to be saved into the memory for caching, and serialize the data to be saved through the description method of a preset data model to obtain first serialized data, and send the first serialized data and the URI (Chinese full name is Uniform Resource Identifier, English full name is Uniform Resource Identifier) of the data to be saved to the database proxy module.
[0079] In a possible implementation, before obtaining a data processing request, the embodiment of the present application may also initialize the business module, including data model description method registration, resource construction, resource destruction, data initialization, data recovery, and configuration loading.
[0080] Among them: The description method registration of the data model is to bind different data with a common serialization method. When the business module is initialized, various data types used in the business module are associated with a common serialization method. Serialization is the process of converting a data structure or object state into a format that can be stored or transmitted (such as JSON, XML, etc.). By registering the description method of the data model, it can be ensured that different types of data can be correctly serialized and deserialized when the data is saved and restored.
[0081] Resource construction is used to create resources such as locks, message queues, and threads used by business modules. When a business module is started, various resources required for the operation of the business module are created. These resources may include synchronization mechanisms (such as locks), message queues for task scheduling and communication, and threads for executing tasks. These resources are crucial for the normal operation of business modules.
[0082] Resource destruction corresponds to resource construction, which means releasing or destroying previously created resources when the business module is stopped or restarted. This is the opposite process of resource construction, ensuring that all resources can be properly cleaned up at the end of the module life cycle to avoid resource leakage.
[0083] Data initialization is used to assign default values to data in the cache and database. When the business module is started, the initial value or default value is set for the data in the cache and database to ensure that the module can start running in a preset state even without historical data.
[0084] Data recovery is used to read data from the database and refresh the cache. When a business module is restarted or needs to be restored to a previous state, the previously saved data is read from the database and loaded into the cache to restore to the previous state. Data recovery usually occurs after a hot restart or hot upgrade to ensure business continuity.
[0085] Configuration loading is used to configure the hardware. When the business module starts, the hardware device is set according to the preset configuration. Configuration loading may include network settings, storage configuration, processor parameters, etc. to ensure that the hardware device works as expected.
[0086] In S202, the database proxy module determines the authority of the data processing request according to the role information and storage path of the data processing device.
[0087] When the data processing request is a data saving request, the authority of the data saving request can be determined based on the database proxy module including an event listening submodule, an event processing submodule, an authority management submodule and a platform information management submodule, including:
[0088] When the event monitoring submodule monitors the data saving request, the data saving request is sent to the event processing submodule and the authority management submodule;
[0089] The authority management submodule obtains the role information of the current device from the platform information management submodule, and parses the uniform resource identifier of the data to be saved to obtain the storage path for data saving, and determines the authority of the data saving request according to the role information and the storage path.
[0090] The uniform resource identifier can include information such as database sub-library, module name, table name, primary key, internal path of data, etc. For example, the uniform resource identifier can be:
[0091] / UserDB / UserManagement / UserInfo / 123 / Address
[0092] The uniform resource identifier indicates that in the "UserDB" database sub-database, the "UserInfo" table under the "UserManagement" module is accessed, a record with a primary key of 123 is searched, and the "Address" field information in the record is obtained.
[0093] Among them, the resource data for processing can be determined through the storage path, and the role information of the current device can be used to determine whether the current device has the authority to process the resource data according to the pre-set permission table, including the authority to save resource data, the authority to restore resource data, the write authority of each module, and the broadcast authority of subscription messages.
[0094] In S203, when the data processing request has processing authority, the database proxy module interacts with the database module according to the data processing request.
[0095] When the data processing request is a data saving request and the data saving request has saving permission, the permission management submodule sends permission confirmation information and storage path to the event processing submodule, the event processing submodule in the database proxy module deserializes the first serialized data to obtain first deserialized data, and the event processing submodule stores the first deserialized data to the database module according to the storage path.
[0096] When the data processing request is a data recovery request, the event monitoring submodule in the database proxy module can monitor the data recovery request and determine whether the authority to perform data recovery is available through the uniform resource identifier. If the authority to perform data recovery is available, the data recovery request can be sent to the event processing submodule, and the uniform resource locator (used to identify the storage location of the data to be recovered) corresponding to the data cache request can be parsed by the event processing submodule to obtain the storage path of the data to be cached, including information such as data sub-library, module name, table name, primary key and internal path of the data.
[0097] The event processing submodule in the database proxy module can obtain the data to be cached from the database module according to the storage path, and serialize the obtained data to obtain second serialized data, and send the second serialized data to the data cache module. The data cache module deserializes the second serialized data to obtain second deserialized data, and can cache the second deserialized data to refresh the cache.
[0098] In a possible implementation, the database proxy module in the embodiment of the present application may also interact with the UI module / hardware management module. Figure 3 As shown, the embodiment of the present application can receive configuration data through the UI module, and send the serialized configuration data and the uniform resource identifier of the configuration data to the database proxy module, or can also detect hardware event data through the hardware management module, and send the serialized hardware event data and the uniform resource identifier corresponding to the hardware event data to the database proxy module. Among them, the hardware event data includes the operating status data of the hardware, etc.
[0099] When the event monitoring submodule monitors configuration data or hardware event data, it can obtain the role information of the current device according to the platform information management submodule, that is, determine whether it is a master device or a slave device, and determine the data writing permission of the module in the device according to the role information.
[0100] For example, if the current device is a master device, then the database proxy module can be used to perform write operations on any module in the master device without limiting the master device's write permission on any module.
[0101] If the current device is a slave device, the write permission may be granted based on the module name in the uniform resource identifier, for example, when the module name in the uniform resource identifier is a UI module and a hardware management module.
[0102] Due to the synchronization mechanism of the database itself, the databases on both the master and slave devices will trigger subscription messages. The event listening submodule in the device listens to and obtains the subscription message. The event listening submodule first obtains the local role information based on the platform information management submodule. If it is a master device, no permission restriction is imposed on the subscription message broadcast. If the current device is a slave device, only the slave device is allowed to broadcast the subscription message whose module name in the URI ( / data sub-library / module name / table name / primary key / {data internal path}) is the UI module or the hardware module. The message is then sent to the event processing submodule for processing, including format conversion processing and serialization processing. Finally, the processed message is broadcast to the business module, UI module, or hardware module.
[0103] When the device receives a subscription message, the UI module receives the subscription message and can obtain and display the results of the configuration sent; when the hardware management module receives the subscription message, it can perform corresponding configuration according to the subscription message; the business module receives the subscription message and runs the corresponding business logic. If the operation result needs to be written to the database, only the business module on the master device is allowed to write, because in the stacking system, the slave device usually cannot receive the message, so the result of the business module on the slave device running the subscription message may be incorrect. If the business module of the slave device is allowed to write to the database module of the master device, the correct result in the database module of the master device may be overwritten, and if the result triggers the broadcast of the subscription message, it will cause the business operation to go wrong.
[0104] The embodiment of the present application reduces data interaction through a data cache module, and controls data access permissions through a database proxy module, which is beneficial to improving the consistency and security of data between various devices. Data identification and access permissions are controlled through a uniform resource identifier, which is beneficial to flexible data management. By monitoring stack topology changes and processing data recovery requests, stacked device addition and splitting can be completed without additional equipment, so that the stacking system is supported in the case of module decoupling and the system can operate normally and effectively.
[0105] Figure 4 A schematic diagram of a data storage implementation process provided in an embodiment of the present application is described in detail as follows:
[0106] In S401, the business module sends a data write request to the data cache module.
[0107] In S402, the data cache module writes the data to be written into the memory.
[0108] In S403, the data cache module serializes the data to be written by using the description method of the pre-registered data model.
[0109] In S404, the data cache module sends the serialized data to be written and the uniform resource identifier corresponding to the data to be written to the database proxy module.
[0110] In S405, the event monitoring submodule monitors the data writing request and performs writing permission determination through the platform information management submodule and the permission management submodule.
[0111] The write permission can be based on the module name, device name, storage path included in the uniform resource identifier, combined with a preset permission table query to determine whether there is write permission to write the data to be written into the database module.
[0112] In S406, when the device has write permission, the event monitoring submodule sends the data write request to the event processing submodule.
[0113] In S407, the event processing submodule parses the uniform resource identifier to obtain the storage path of the data to be written.
[0114] In S408, the event processing submodule performs deserialization processing and format conversion processing on the data to be written, and converts the data to be written into a data format compatible with the database module.
[0115] In S409, the converted data to be written is written into the database module according to the storage path.
[0116] This data writing method caches the data to be written in memory. When writing data, it can first search in the memory. If it hits directly, it does not need to interact with the database module, which can reduce the number of I / O operations of the database module and improve system performance. And by controlling data writing through permissions, the reliability of system business operation can be effectively improved.
[0117] Figure 5 A schematic diagram of a data recovery method according to an embodiment of the present application is provided, as follows:
[0118] In S501, the data cache module receives a data recovery instruction.
[0119] In S502, the data cache module sends a data recovery request to the database proxy module.
[0120] In S503, the event monitoring submodule monitors the data recovery request and performs recovery authority determination through the platform information management submodule and the authority management submodule.
[0121] In S504, when the device has the restoration authority, the event monitoring submodule sends the data restoration request to the event processing submodule.
[0122] In S505, the event processing submodule parses the uniform resource identifier to obtain the storage path of the data to be restored.
[0123] In S506, according to the storage path, the event processing submodule reads the data to be restored in the database module and performs format conversion and serialization conversion.
[0124] In S507, the event processing submodule sends the converted data to be restored to the event monitoring submodule.
[0125] In S508, the event monitoring submodule returns the converted data to be restored to the data storage module and deserializes it.
[0126] In S509, the deserialized data to be restored is refreshed to the memory.
[0127] The data recovery method can effectively improve the reliability of data recovery operations by controlling data writing through permissions.
[0128] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0129] Figure 6 A schematic diagram of a data processing device provided in an embodiment of the present application, the device is applied to a master device or a slave device in a stacking system, the master device and the slave device both include a data cache module, a database proxy module and a database module, the data cache module is used to cache device data, the device includes:
[0130] A data processing request acquisition unit 601 is used to acquire a data processing request through the data cache module and send the data processing request to the database proxy module;
[0131] The authority determination unit 602 is used for determining the authority of the data processing request according to the role information and storage path of the data processing device by the database proxy module;
[0132] The database module updating unit 603 is used for, when the data processing request has processing authority, for the database proxy module to interact with the database module according to the data processing request.
[0133] Figure 6 The data processing device shown is Figure 2 The data processing method shown corresponds to.
[0134] Figure 7 Schematic diagram of a data processing device provided in an embodiment of the present application. Figure 7 As shown, the data processing device 7 of this embodiment includes: a processor 70, a memory 71, and a computer program 72 stored in the memory 71 and executable on the processor 70, such as a data processing program. When the processor 70 executes the computer program 72, the steps in the above-mentioned data processing method embodiments are implemented. Alternatively, when the processor 70 executes the computer program 72, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0135] Exemplarily, the computer program 72 may be divided into one or more modules / units, which are stored in the memory 71 and executed by the processor 70 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 72 in the data processing device 7.
[0136] The data processing device 7 may be a network device such as a router or a switch. The data processing device may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art will appreciate that Figure 7 It is only an example of a data processing device 7 and does not constitute a limitation of the data processing device 7. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the data processing device may also include input and output devices, network access devices, buses, etc.
[0137] The processor 70 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0138] The memory 71 may be an internal storage unit of the data processing device 7, such as a hard disk or memory of the data processing device 7. The memory 71 may also be an external storage device of the data processing device 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the data processing device 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the data processing device 7. The memory 71 is used to store the computer program and other programs and data required by the data processing device. The memory 71 may also be used to temporarily store data that has been output or is to be output.
[0139] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0140] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0141] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0142] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0143] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0144] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0145] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method, and can also be completed by hardware related to computer program instructions. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0146] In addition, an embodiment of the present application also provides a computer program product, which, when executed on a computer, enables the computer to execute the methods in the above-mentioned implementation modes.
[0147] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A data processing method, characterized in that: The method is applied to a master device or a slave device in a stacking system, wherein the master device and the slave device both include a data cache module, a database proxy module and a database module, and the data cache module is used to cache device data. The method includes: The data cache module obtains a data processing request and sends the data processing request to the database proxy module; The database proxy module determines the authority of the data processing request according to the role information and storage path of the data processing device; When the data processing request has processing authority, the database proxy module interacts with the database module according to the data processing request.
2. The method according to claim 1, characterized in that The data processing request is a data preservation request; The data cache module obtains a data processing request and sends the data processing request to the database proxy module, including: The data cache module obtains the data saving request and writes the data to be saved into the cache; The data cache module serializes the data to be saved by a predetermined data model description method to obtain first serialized data, and sends the first serialized data to the database proxy module; The database proxy module interacts with the database module according to the data processing request, including: The database proxy module deserializes the first serialized data to obtain first deserialized data; According to the storage path obtained by parsing the data saving request, the database proxy module stores the deserialized data in the database module.
3. The method according to claim 2, characterized in that The database proxy module includes an event monitoring submodule, an event processing submodule, a rights management submodule and a platform information management submodule; The database proxy module determines the authority of the data processing request according to the role information and storage path of the data processing device, including: After monitoring the data saving request, the event monitoring submodule sends the data saving request to the event processing submodule and the authority management submodule; The authority management submodule obtains the role information of the current device from the platform information management submodule, and parses the uniform resource identifier of the data to be saved to obtain the storage path for saving the data, and determines the authority of the data saving request according to the role information and the storage path; When the data processing request has processing authority, the database proxy module interacts with the database module according to the data processing request, including: After receiving the permission confirmation information and the storage path from the permission management submodule, the event processing submodule stores the first deserialized data in the database module according to the storage path.
4. The method according to claim 1, characterized in that: The data processing request is a data recovery request; When the data processing request has processing authority, the database proxy module interacts with the database module according to the data processing request, including: The database proxy module parses the uniform resource locator corresponding to the data cache request to obtain the storage path of the data to be cached; The database proxy module obtains the data to be cached from the database module according to the storage path; The database proxy module performs serialization processing on the acquired data to obtain second serialized data; The database proxy module sends the second serialized data to the data cache module, and the data cache module deserializes the second serialized data to obtain and cache second deserialized data.
5. The method according to claim 1, characterized in that Before the data cache module obtains the data processing request, the method further includes: The database proxy module monitors the topology structure change information of the stacking system; If the current device is a slave device, the topology change information is sent to an upper-layer device, and a data recovery request determined by the upper-layer device according to the split change information of the stacking system is received.
6. The method according to any one of claims 1 to 5, characterized in that: The master device and the slave device further include a UI module and a hardware management module; Before the database proxy module determines the authority of the data processing request according to the role information and storage path of the data processing device, the method further includes: Receiving configuration data through the UI module, and sending the configuration data and the uniform resource identifier of the configuration data to the database proxy module, and / or detecting hardware event data through the hardware management module, and sending the hardware event data and the uniform resource identifier corresponding to the hardware event data to the database proxy module; The database proxy module determines the authority of the data processing request according to the role information and / or storage path of the data processing device, including: If the current device is a master device, the database proxy module does not restrict the write permission of any module in the master device; If the current device is a slave device, the database proxy module determines that the module with write permission is the UI module and / or the hardware management module according to the uniform resource identifier corresponding to the configuration data and / or the hardware event data.
7. The method according to claim 6, characterized in that The master device and the slave device further include a service module; Before receiving configuration data through the UI module and sending the configuration data and the uniform resource identifier of the configuration data to the database proxy module, and / or detecting hardware event data through the hardware management module and sending the hardware event data and the uniform resource identifier corresponding to the hardware event data to the database proxy module, the method further includes: The master device broadcasts a first permission range of a subscription message, and determines a second permission range of the slave device to send a subscription message; Broadcasting a subscription message according to the first authority scope and the second authority scope; When the data processing request has processing authority, the database proxy module interacts with the database module according to the data processing request, including: When the data processing request has processing authority, the configuration result of the subscription message is displayed through the UI module, or the configuration corresponding to the subscription message is run through the hardware management module, or the business logic corresponding to the subscription message is run through the business module.
8. A data processing device, characterized in that: The device is applied to a master device or a slave device in a stacking system, the master device and the slave device both include a data cache module, a database proxy module and a database module, the data cache module is used to cache device data, and the device includes: A data processing request acquisition unit, configured to acquire a data processing request from the data cache module and send the data processing request to the database proxy module; A permission determination unit, configured to determine the permission of the data processing request according to the role information and storage path of the data processing device by the database proxy module; The database module updating unit is used for, when the data processing request has processing authority, for the database proxy module to interact with the database module according to the data processing request.
9. A data processing device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the data processing device is caused to implement the method according to any one of claims 1 to 7.
10. A computer program product comprising computer program instructions, characterized in that When the computer program is executed, the method according to any one of claims 1 to 7 is performed.
Citation Information
Cited By
Data processing method and device, storage medium and electronic equipment
CN120710901A