CN113794652A - Data processing method and device, electronic equipment and storage medium - Google Patents

Data processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113794652A
CN113794652A CN202111138435.9A CN202111138435A CN113794652A CN 113794652 A CN113794652 A CN 113794652A CN 202111138435 A CN202111138435 A CN 202111138435A CN 113794652 A CN113794652 A CN 113794652A
Authority
CN
China
Prior art keywords
module
processing
service
equipment
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111138435.9A
Other languages
Chinese (zh)
Inventor
王猛
柳海洋
陈颖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Lingshi Communication Technology Development Co ltd
Original Assignee
Shanghai Lingshi Communication Technology Development Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Lingshi Communication Technology Development Co ltd filed Critical Shanghai Lingshi Communication Technology Development Co ltd
Priority to CN202111138435.9A priority Critical patent/CN113794652A/en
Publication of CN113794652A publication Critical patent/CN113794652A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention relates to the technical field of business systems, in particular to a data processing method, a device, electronic equipment and a storage medium, wherein the method comprises the steps of obtaining a message to be processed, wherein the message to be processed comprises an equipment type and an identification of target equipment; distributing the message to be processed to a corresponding service processing module for processing based on the equipment type; and distributing the processing result of the service processing module to a corresponding interface module for processing based on the equipment type and the identification so as to send the processing result to the target equipment. Through the layered decoupling of the service processing and the interface processing, parallel data processing can be performed by utilizing each module, and the data processing efficiency is improved; meanwhile, for developers, specific implementation details of each module do not need to be known, and only how to call the interface needs to be known, so that the development efficiency is improved.

Description

Data processing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the technical field of system architecture, and in particular, to a data processing method, apparatus, electronic device, and storage medium.
Background
With the continuous improvement of industry informatization construction and the perfection of network construction, business personnel basically realize the online whole flow in daily office. The scene of audio and video remote communication related in the service system, such as remote access, remote visit and the like, provides application environment support for the intelligent service.
However, since the business system and the audio and video system are respectively organized and belong to different fields, the requirement for designing, developing and testing personnel to be completely familiar with the business system and the audio and video system as a whole is high. The developed application system processes data of all business systems and audio and video systems as a whole, resulting in low data processing efficiency.
Disclosure of Invention
In view of this, embodiments of the present invention provide a data processing method, an apparatus, an electronic device, and a storage medium, so as to solve the problem of low data processing efficiency.
According to a first aspect, an embodiment of the present invention provides a data processing method, including:
acquiring a message to be processed, wherein the message to be processed comprises a device type and an identifier of target equipment;
distributing the message to be processed to a corresponding service processing module for processing based on the equipment type;
and distributing the processing result of the service processing module to a corresponding interface module for processing based on the equipment type and the identification so as to send the processing result to the target equipment.
According to the data processing method provided by the embodiment of the invention, the service processing module and the interface module are utilized to perform corresponding processing, so that information transmission from an upper layer service to a target device is realized, namely, through layered decoupling of service processing and interface processing, parallel data processing can be performed by utilizing different service processing modules and interface modules, and the data processing efficiency is improved; meanwhile, for developers, specific implementation details of each module do not need to be known, and only how to call the interface needs to be known, so that the development efficiency is improved.
With reference to the first aspect, in a first implementation manner of the first aspect, the distributing, based on the device type and the identifier, the processing result of the service processing module to a corresponding interface module for processing, so as to send the processing result to the target device includes:
acquiring a processing result of the service processing module;
calling a target process to distribute the processing result to an interface module corresponding to the equipment type, and processing a data protocol and a data format on the processing result by using the interface module;
and sending the processing result of the interface module to the target equipment based on the identification.
The data processing method provided by the embodiment of the invention uniformly distributes the processing result of the service processing module by using the target process, and can realize uniform distribution and monitoring of the request data.
With reference to the first aspect, in a second implementation manner of the first aspect, the interface module includes a service sub-module and an adaptation sub-module, and the distributing the processing result of the service processing module to the corresponding interface module for processing based on the device type and the identifier, so as to send the processing result to the target device includes:
determining a corresponding target service sub-module based on the equipment type, and distributing a processing result of the business processing module to the target service sub-module;
acquiring and determining at least one adaptation submodule corresponding to the target service submodule according to the corresponding relation between the service submodule and the adaptation submodule;
determining a target adaptation sub-module corresponding to the target equipment from the at least one adaptation sub-module according to the identification and a pre-established one-to-one correspondence relationship between the adaptation sub-modules and the equipment;
and distributing the processing result of the business processing module to the corresponding target adapter module for processing based on the target service sub-module so as to send the processing result of the target adapter sub-module to the target equipment.
The data processing method provided by the embodiment of the invention realizes the processing of a large amount of data on the premise of not influencing the system performance by corresponding the adapter module and the service submodule.
With reference to the second implementation manner of the first aspect, in a third implementation manner of the first aspect, the obtaining and determining at least one adaptation sub-module corresponding to the target service sub-module according to a correspondence between the service sub-module and the adaptation sub-module includes:
the main service sub-module acquires a registration request sent by an adapter sub-module corresponding to the equipment;
the main service sub-module determines whether the registration request carries an identifier of an adaptation sub-module corresponding to the equipment;
when the identifier of the adaptation submodule is not carried, determining that the adaptation submodule corresponding to the equipment is a newly registered adaptation submodule and allocating a corresponding identifier for the adaptation submodule corresponding to the equipment, and establishing a corresponding relationship between the service submodule and an adaptation submodule corresponding to the equipment based on a corresponding relationship between the main service submodule and the at least one slave service submodule;
and determining at least one adaptation sub-module corresponding to the target service sub-module based on the corresponding relation.
According to the data processing method provided by the embodiment of the invention, the master service submodule and the slave service submodule are arranged, namely, the slave service submodule is used for backing up the master service submodule, so that the reliability of data processing is ensured.
With reference to the second implementation manner of the first aspect, in a fourth implementation manner of the first aspect, the obtaining a correspondence between the service submodule and the adaptor submodule further includes:
when the service submodule receives connection requests sent by at least two adapter submodules, the service submodule determines whether the connection requests come from the same equipment or not based on the identification of the adapter submodules;
when the connection request is from the same device, the service submodule responds only to the earliest connection request.
According to the data processing method provided by the embodiment of the invention, when the same device sends the connection request to the service submodule through the at least two adapter submodules, the service submodule only responds to the earliest connection request so as to avoid repeated processing of the same data and improve the data processing efficiency.
With reference to the first aspect, or any one of the first to fourth embodiments of the first aspect, in a fifth embodiment of the first aspect, the method further comprises:
acquiring to-be-processed data sent by the target equipment based on an interface module corresponding to the equipment type, wherein the to-be-processed data comprises the equipment type of the target equipment and the identification of a target user;
distributing the processing result of the interface module to a corresponding service processing module for processing based on the equipment type;
and sending the processing result of the service processing module to the target user based on the identification of the target user.
In the data processing method provided by the embodiment of the invention, the service processing module and the interface module are used for carrying out corresponding processing, so that the data transmission of the target equipment to the upper-layer service is realized, namely, through the layered decoupling of the service processing and the interface processing, each module can be used for carrying out parallel data processing, and the data processing efficiency is improved; meanwhile, for developers, specific implementation details of each module do not need to be known, and only how to call the interface needs to be known, so that the development efficiency is improved.
With reference to the fifth implementation manner of the first aspect, in a sixth implementation manner of the first aspect, the distributing the processing result of the interface module to a corresponding service processing module for processing based on the device type includes:
processing a data protocol and a data format of the data to be processed by using an interface module corresponding to the equipment type;
and calling a target process to distribute the processing result of the interface module to a service processing module corresponding to the equipment type for processing.
The data processing method provided by the embodiment of the invention uniformly distributes the processing result of the interface module by using the target process, and can realize uniform distribution and monitoring of the request data.
According to a second aspect, an embodiment of the present invention further provides a data processing apparatus, including:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a message to be processed, and the message to be processed comprises the device type and the identifier of target equipment;
the distribution unit is used for distributing the message to be processed to the corresponding service processing module for processing based on the equipment type;
and the processing unit is used for distributing the processing result of the service processing module to the corresponding interface module for processing based on the equipment type and the identification so as to send the processing result to the target equipment.
The data processing device provided by the embodiment of the invention utilizes the service processing module and the interface module to carry out corresponding processing, realizes information transmission from an upper layer service to target equipment, namely realizes layered decoupling of service processing and interface processing, can utilize each module to carry out parallel data processing, and improves the data processing efficiency; meanwhile, for developers, specific implementation details of each module do not need to be known, and only how to call the interface needs to be known, so that the development efficiency is improved.
According to a third aspect, an embodiment of the present invention provides an electronic device, including: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing therein computer instructions, and the processor executing the computer instructions to perform the data processing method according to the first aspect or any one of the embodiments of the first aspect.
According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores computer instructions for causing a computer to execute the data processing method described in the first aspect or any one of the implementation manners of the first aspect.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic diagram of a data processing system according to an embodiment of the present invention;
FIG. 2 is a flow diagram of a data processing method according to an embodiment of the invention;
FIG. 3 is a flow chart of a data processing method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an interface module according to an embodiment of the invention;
FIG. 5 is a schematic diagram of an interface module according to an embodiment of the invention;
FIG. 6 is a schematic diagram of a data processing system according to an embodiment of the present invention;
FIG. 7 is a flow chart of a data processing method according to an embodiment of the present invention;
FIG. 8 is a block diagram of a data processing apparatus according to an embodiment of the present invention;
fig. 9 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The data processing method provided by the embodiment of the invention is based on a data processing system to process data, and a service processing module and an interface module are packaged in the data processing system. The service processing module corresponds to the equipment type and is used for processing the corresponding service; the interface module corresponds to the type of the equipment and is used for processing the received data so as to be conveniently sent to the service processing module upwards and sent to the equipment downwards. The device types include, but are not limited to, a monitoring platform, a conference device, a conference platform, a unified device management platform, and the like, for example, for the monitoring platform, the functions of the service processing module include, but are not limited to, audio/video code stream processing, target person positioning, and the like; for the conference device, the functions of the service processing module include, but are not limited to, mixing, picture composition, and the like. The interface module is used to convert the data to match the data protocol and data format of the receiving end (device or user layer), etc. The functions of the specific service processing module and the interface module may be set according to actual requirements, and are not limited herein.
FIG. 1 shows an alternative embodiment of a data processing system including a user plane, a device service, a traffic processing module, an interface module, and a device. The user layer comprises user equipment, the service processing module and the interface module correspond to equipment types, and equipment 1-equipment n represent equipment of the equipment layer and correspond to n equipment types. The user layer supports a user to access the data system through a PC or a mobile phone, and other processing layers, such as a gateway layer, an industry service layer, and the like, exist between the user layer and the device service, and may be specifically set according to actual requirements, which is not limited herein. The service processing module in fig. 1 is responsible for audio and video device management, operation, status notification, and the like. The interface module mainly performs access control on the json data carriers which pass through a tcp link json under the sdk dynamic or http protocol mode.
Optionally, the data system includes a unified base platform, and the unified base platform process includes system services, log services, file services, media services, and the like, in addition to the device services described above. The system service provides the configuration of units, departments, users, roles and resources; the equipment service provides management, operation and state control of audio and video equipment and security equipment; the log service provides and collects system service running logs and user operation logs; the file service provides functions of uploading and downloading files and consulting basic information of the files; the media service is a layer encapsulated on the basis of a new media service, and provides unified media-related service functions such as rtsp, webrtc and the like.
Further optionally, the data system further comprises a base component and a registry. The basic components can comprise three types of redis, kafka and mysql, wherein the redis provides high-performance real-time cache, the kafka provides high-throughput high-performance intermediate message processing middleware, and the mysql provides data persistence; the registry is used for managing the server where the data system is located. For example, the registry includes Nacos, which is used for service administration, such as service registration and discovery, service synchronization, service renewal, and service invocation, and also used for dynamically configuring services, such as database user name and password in application.
It should be noted that the service processing module and the interface module in the data processing system may be disposed on the same electronic device, or may be disposed on different electronic devices, which is not limited herein. For example, the service processing module and the interface module are disposed on the same server, or a part of the service processing module and a part of the interface module are disposed on the server 1, and another part of the service processing module and another part of the interface module are disposed on the server 2. The service processing module and the interface module are described in detail below as operating on the same electronic device.
The data processing system can not only realize that the equipment of the equipment layer (equipment 1-equipment n shown in figure 1) sends data to the equipment of the user layer, but also realize that the equipment of the user layer sends data to the equipment of the equipment layer, thereby realizing the bidirectional transmission of the data.
Because the corresponding service processing module and the interface module are packaged, for a developer, the developer only needs to know how to call the corresponding interface when developing the corresponding data processing system, and does not need to concern about the specific data processing logic in each packaging module, so that the efficiency of developing the data system is improved. Meanwhile, for data processing, the service processing module and the interface module are packaged modules and can run in parallel, so that the data processing efficiency is improved.
In the following description, data transmission from a device of a user layer to a device of a device layer and from a device of a device layer to a device of a user layer are described, respectively. The data processing system is particularly denoted below by means of a data stream.
In accordance with an embodiment of the present invention, there is provided a data processing method embodiment, it should be noted that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
In the embodiment, a data processing method is provided, which can be used in electronic devices, such as servers, computers, and the like. Taking an example that a device of a user layer sends a message to a device of a device layer, fig. 2 is a flowchart of a data processing method according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
and S11, acquiring the message to be processed.
Wherein the message to be processed comprises the device type and the identification of the target device.
When the device of the user layer performs corresponding processing on the device of the device layer, the device of the user layer needs to send a message to be processed to the electronic device equipped with the data processing system, and the electronic device processes the message to be processed and then sends the result to the corresponding target device. The message to be processed needs to carry the device type and the identifier of the target device, where the target device is the target device of the device layer, and the identifier is used to uniquely indicate the target device.
For example, the pending message may be expressed as: device type a-identity a 11-specific handling message.
And S12, distributing the message to be processed to the corresponding service processing module for processing based on the device type.
After the electronic device acquires the message to be processed, the device type in the message to be processed is analyzed, the service processing module corresponding to the device type is searched by using the device type, and the message to be processed is distributed to the service processing module for processing. For example, the correspondence between the service processing module and the device type may be stored in the electronic device, and the electronic device may determine the corresponding service processing module by using the correspondence.
Optionally, the electronic device may be packaged with service processing modules corresponding to N device types, and whenever a device of a new device type accesses the data processing system, the electronic device needs to update the correspondence between the service processing module and the device type, so that the service processing module corresponding to the new device type is started. If the data processing system does not have a device of a certain device type to access, the service processing module corresponding to the device type may not be started.
And S13, distributing the processing result of the service processing module to the corresponding interface module for processing based on the device type and the identifier, so as to send the processing result to the target device.
The electronic equipment processes the message to be processed by using the service processing module, then determines a corresponding interface module by using the equipment type, performs data conversion by using the interface module, and finally sends the processing result to the target equipment by using the identification of the target equipment. As shown in fig. 1, the electronic device receives a to-be-processed message sent by a device on a user layer by using a device service, determines a service processing module 1 based on a device type of a target device, and distributes the to-be-processed message to the service processing module 1 for corresponding processing. And then, the electronic equipment determines the corresponding interface module 1 by using the equipment type, sends the processing result of the service processing module 1 to the interface module 1 for data conversion, and finally sends the data conversion result to the corresponding target equipment by using the identification of the target equipment.
Details about this step will be described later.
In the data processing method provided by this embodiment, the service processing module and the interface module are used to perform corresponding processing, so as to realize information transmission from an upper layer service to a target device, that is, by performing layered decoupling of service processing and interface processing, parallel data processing can be performed by using different service processing modules and interface modules, thereby improving data processing efficiency; meanwhile, for developers, specific implementation details of each module do not need to be known, and only how to call the interface needs to be known, so that the development efficiency is improved.
In this embodiment, a data processing method is provided, which can be used in electronic devices, such as servers, computers, etc., fig. 3 is a flowchart of a data processing method according to an embodiment of the present invention, and as shown in fig. 3, the flowchart includes the following steps:
and S21, acquiring the message to be processed.
Wherein the message to be processed comprises the device type and the identification of the target device.
Please refer to S11 in fig. 2 for details, which are not described herein.
And S22, distributing the message to be processed to the corresponding service processing module for processing based on the device type.
Please refer to S12 in fig. 2 for details, which are not described herein.
And S23, distributing the processing result of the service processing module to the corresponding interface module for processing based on the device type and the identifier, so as to send the processing result to the target device.
Specifically, S23 includes:
s231, acquiring a processing result of the service processing module.
The electronic device may store the processing results of the service processing modules in a unified manner, or may store the processing results of the service processing modules in corresponding positions respectively.
And S232, calling the target process to distribute the processing result to an interface module corresponding to the equipment type, and processing the processing result by using the interface module to carry out data protocol and data format processing.
After the service processing module finishes processing the message to be processed, the electronic equipment calls a target process, and the target process is utilized to distribute a processing result to an interface module corresponding to the equipment type. As shown in fig. 4, the interface module corresponding to the unified device platform is devunit, the interface module corresponding to the conference platform is devmcu, the interface module corresponding to the conference device is devmt, and the interface module corresponding to the monitoring platform is devmpt. Of course, fig. 4 is merely an example, and does not limit the scope of the present invention.
As shown in fig. 4, the target process is responsible for routing all message requests, with upper layer requests being distributed through this process. The upper layer request refers to a request initiated by a business service, the request is forwarded to the interface module through the equipment service, and is uniformly distributed through a target process in the interface module, wherein the target process is one and only one, and the input parameter and the output parameter of all the requests are monitored in real time and output to a log file.
If the device type corresponding to the currently processed message to be processed is the conference platform, the electronic device distributes the processing result of the service processing module to an interface module corresponding to the conference platform by using the target process, namely to devmcu for data conversion.
S233, the processing result of the interface module is transmitted to the target device based on the identifier.
After receiving the data, the interface module converts the data, determines the target equipment by using the identification of the target equipment, and finally sends the processing result of the interface module to the target equipment.
A plurality of devices of the same device type can be accessed under each interface module, and the devices are distinguished through device identifiers. For example, 3 unified device platforms are accessed under devunit, 2 conference platforms are accessed under devmcu, and the like.
The data processing method provided by this embodiment uniformly distributes the processing result of the service processing module by using the target process, and can realize uniform distribution and monitoring of the request data.
As an optional implementation manner of this embodiment, when there is more device access data of a certain device type in the data processing system, the interface module may be implemented in a manner of a service sub-module and an adaptation sub-module. Specifically, the interface module includes a service submodule and an adaptation submodule, and the S23 may further include:
(1) and determining a corresponding target service submodule based on the equipment type, and distributing a processing result of the business processing module to the target service submodule.
(2) And obtaining and determining at least one adaptation sub-module corresponding to the target service sub-module according to the corresponding relation between the service sub-module and the adaptation sub-module.
One adaptation submodule can access at least one service submodule, and one adaptation submodule corresponds to one device. The service submodule is used for distributing data, for example, upper layer data is distributed to a corresponding adapter submodule, or data from the adapter submodule is transmitted upwards, and the like; the adapter sub-module is used for converting the received data so as to facilitate the processing of the receiving end.
The corresponding relationship between the service sub-module and the adaptor sub-module may be predetermined, or determined when the adaptor sub-module registers with the service sub-module.
In some optional implementations of this embodiment, the service sub-modules include a master service sub-module and at least one slave service sub-module, and the slave service sub-module is configured to implement data backup. The step (2) of S23 may include:
1.1) the main service sub-module obtains the registration request sent by the adapter sub-module corresponding to the device.
1.2) the main service sub-module determines whether the registration request carries the identification of the adaptation sub-module.
1.3) when the identifier of the adaptation submodule is not carried, determining that the adaptation submodule corresponding to the equipment is a new registration adaptation submodule and distributing a corresponding identifier for the adaptation submodule corresponding to the equipment, and establishing a corresponding relation between the service submodule and the adaptation submodule corresponding to the equipment based on the corresponding relation between the service submodule and at least one slave service submodule.
1.4) determining at least one adaptation submodule corresponding to the target service submodule based on the corresponding relation.
Specifically, since the adaptation submodule and the device are in one-to-one correspondence, the identifier of the device may also be regarded as the identifier of the adaptation submodule. When the newly started adaptor module does not have the self identification, the newly started adaptor module generates a corresponding identification when registering with the main service sub-module and the main service sub-module receives the registration request and finds that no identification exists, and carries the identification in the registration response. If the adaplet module without self identification sends a registration request to the slave service sub-module, the slave service sub-module does not respond to the registration request. When the main service sub-module receives the registration request of the adaptation sub-module, the corresponding relation between the main service sub-module and at least one slave service sub-module is utilized to correspond the adaptation sub-module to at least one slave service sub-module, and then the corresponding relation between the service sub-module and the adaptation sub-module is established.
The adapter submodule may receive the issued configuration data from the master service submodule and the slave service submodule, but the master service submodule is taken as a standard.
The reliability of data processing is ensured by setting the master service sub-module and the slave service sub-module, namely, the slave service sub-module is used for backing up the master service sub-module.
(3) And determining a target adaptation sub-module corresponding to the target equipment from at least one adaptation sub-module according to the identification and the pre-established one-to-one correspondence between the adaptation sub-modules and the equipment.
(4) And distributing the processing result of the business processing module to the corresponding target adaptation sub-module for processing based on the target service sub-module so as to send the processing result of the target adaptation sub-module to the target equipment.
After the electronic equipment determines a target service sub-module by using the equipment type, distributing a processing result of an upper-layer business processing module to the target service sub-module, and determining a target adaptation sub-module by using the corresponding relation and the identification of the target service sub-module and an adaptation sub-module; and distributing the processing result of the service processing module to the corresponding target adaptation submodule for processing, and finally sending the processing result of the target adaptation submodule to the corresponding target equipment.
Further, when the adapter submodule sends a registration request to the service submodule, the service submodule connected with the adapter submodule is carried to be in a master or slave role. The identifier of each service submodule and the corresponding role thereof can be configured in the configuration file, and then the adapter submodule carries the identifier of the service submodule when sending the registration request, so as to confirm whether the role of the connected service submodule is master or slave. When the main service sub-module receives the registration request, the total data which can carry the loading equipment information and is registered by the adapter sub-module is given to the adapter sub-module so as to ensure the consistency of the data of the adapter sub-module registered in the adapter sub-module and the service sub-module.
For the adaptor module, it only receives the application for adding, deleting and modifying the access device of the device layer issued by the main service sub-module, and the modification information needs to carry the encrypted data such as the user name and password of the access device. If configuration information of the service sub-module accessed by the adaptation sub-module and the change of the master service sub-module and the slave service sub-module are required, the user name and the password are required to be verified, and the user name and the password can be modified after the verification is passed.
When the adapter sub-module is not connected with the main service sub-module or the chain is broken, due to the existence of the slave service sub-module, the equipment layer equipment corresponding to the adapter sub-module can operate according to the existing data and provide changed data for the slave service sub-module, so that the slave service sub-module is utilized to continue data processing; when the adapter sub-module is connected with the main service sub-module and receives the equipment information loaded by the main service sub-module, the equipment condition connected with the adapter sub-module, synchronous alarm and other data are reported; when the adapter submodule is damaged, if the data of the connected equipment is reserved, the new adapter submodule can be used for importing the data of the equipment connected with the damaged adapter submodule from the adapter submodule so as to replace the damaged adapter submodule; when an adapter submodule is copied, the identity of the adapter submodule is also copied, and if the same service submodule subsequently receives connection requests of two adapter submodules with the same identity, the connection requests correspond to the earliest connection request. When the same device sends connection requests to the service sub-module through at least two adapter sub-modules, the service sub-module only responds to the earliest connection request so as to avoid repeated processing of the same data and improve the data processing efficiency.
The adaptation sub-module corresponds to at least one service sub-module to realize data backup and improve the usability of data processing.
As shown in fig. 5, the devices accessed by the device layer are taken as the access control and alarm host as an example. The adaptation sub-module corresponding to the access control is Door _ Adapter, the adaptation sub-module corresponding to the Alarm host is Alarm _ Adapter, the service sub-module corresponding to the Door _ Adapter is a master (Leader) service sub-module and a slave (Follow) service sub-module, which are collectively represented as Door _ Server in fig. 5, the service sub-module corresponding to the Alarm _ Adapter is a master service sub-module and a slave service sub-module, which are collectively represented as Alarm _ Server in fig. 5.
Wherein, one adaptation submodule can access a plurality of service submodules, but there is only one main service submodule in the plurality of service submodules. For the adaptation submodule, the adaptation submodule only responds to the message of the main service submodule, and when the main service submodule fails or the adaptation submodule is not connected with the main service submodule, the adaptation submodule can be switched to the slave service submodule to continue data processing.
For an access control or alarm host, the access control or alarm host needs to carry equipment information when sending data to the adaptor module, so that the upper layer can distinguish the equipment. For example, the door control carries a "door" character in the device information, so that the upper layer code does not need to be greatly modified in subsequent access device type extension.
In some alternative embodiments of the present embodiment, FIG. 6 illustrates an alternative embodiment of a data processing system. For the security device, an interface module as shown in fig. 5 may be adopted; for other device types, an interface module as shown in fig. 4 may be employed. In the data processing system, the information sent by the upper layer is received through the equipment service, or the data reported by the lower layer is uploaded to the equipment of the user layer.
The data processing system realizes access control of audio and video equipment and security equipment through micro-service layering, namely service and interface layering. By encapsulating the service processing module and the interface module, understanding of service developers on how to access control details of the equipment is reduced, thereby improving development efficiency.
In the embodiment, a data processing method is provided, which can be used in electronic devices, such as servers, computers, and the like. Taking a device sending data to an upper layer service as an example, fig. 7 is a flowchart of a data processing method according to an embodiment of the present invention, and as shown in fig. 7, the flowchart includes the following steps:
and S31, acquiring the data to be processed sent by the target device based on the interface module corresponding to the device type.
Wherein the data to be processed comprises the device type of the target device and the identification of the target user.
And S32, distributing the processing result of the interface module to the corresponding service processing module for processing based on the device type.
And S33, sending the processing result of the service processing module to the target user based on the identification of the target user.
The data processing method for sending data to the upper layer service by the device is similar to the data processing method in the above embodiment, and the difference is the trend of the data stream. When the target device needs to report data, the electronic device receives data to be processed sent by the target device by using an interface module corresponding to the device type of the device, processes the data by using the interface module, then determines a service processing module corresponding to the device type, and sends a processing result of the interface module to the corresponding service processing module for processing. And the business processing module sends the processing result to the equipment service and uploads the processing result to the equipment of the user layer through the equipment service.
In the data processing method provided by this embodiment, the service processing module and the interface module are used to perform corresponding processing, so as to implement data transmission of the target device to the upper layer service, that is, by layered decoupling of service processing and interface processing, parallel data processing can be performed by using each module, thereby improving data processing efficiency; meanwhile, for developers, specific implementation details of each module do not need to be known, and only how to call the interface needs to be known, so that the development efficiency is improved.
Optionally, the S33 may include:
(1) and processing the data protocol and the data format of the data to be processed by using the interface module corresponding to the equipment type.
(2) And calling the target process to distribute the processing result of the interface module to a service processing module corresponding to the equipment type for processing.
Similar to the above-mentioned download message, when the electronic device uploads data, the interface module is used to convert the data, and then the target process is called to distribute the processing result to the service processing module corresponding to the device type for processing.
The target process is used for uniformly distributing the processing result of the interface module, so that uniform distribution and monitoring of the request data can be realized.
In this embodiment, a data processing apparatus is further provided, and the apparatus is used to implement the foregoing embodiments and preferred embodiments, and details are not repeated for what has been described. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
The present embodiment provides a data processing apparatus, as shown in fig. 8, including:
an obtaining unit 41, configured to obtain a message to be processed, where the message to be processed includes a device type and an identifier of a target device;
a distributing unit 42, configured to distribute the to-be-processed message to a corresponding service processing module for processing based on the device type;
and the processing unit 43 is configured to distribute, based on the device type and the identifier, a processing result of the service processing module to a corresponding interface module for processing, so as to send the processing result to the target device.
The data processing apparatus provided in this embodiment performs corresponding processing by using the service processing module and the interface module, so as to implement information transmission from an upper layer service to a target device, that is, to implement layered decoupling between service processing and interface processing, and can perform parallel data processing by using each module, thereby improving data processing efficiency; meanwhile, for developers, specific implementation details of each module do not need to be known, and only how to call the interface needs to be known, so that the development efficiency is improved.
The data processing apparatus in this embodiment is presented in the form of functional units, where a unit refers to an ASIC circuit, a processor and memory executing one or more software or fixed programs, and/or other devices that may provide the above-described functionality.
Further functional descriptions of the modules are the same as those of the corresponding embodiments, and are not repeated herein.
An embodiment of the present invention further provides an electronic device, which has the data processing apparatus shown in fig. 8.
Referring to fig. 9, fig. 9 is a schematic structural diagram of an electronic device according to an alternative embodiment of the present invention, and as shown in fig. 9, the electronic device may include: at least one processor 51, such as a CPU (Central Processing Unit), at least one communication interface 53, memory 54, at least one communication bus 52. Wherein a communication bus 52 is used to enable the connection communication between these components. The communication interface 53 may include a Display (Display) and a Keyboard (Keyboard), and the optional communication interface 53 may also include a standard wired interface and a standard wireless interface. The Memory 54 may be a high-speed RAM Memory (volatile Random Access Memory) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The memory 54 may alternatively be at least one memory device located remotely from the processor 51. Wherein the processor 51 may be in connection with the apparatus described in fig. 8, the memory 54 stores an application program, and the processor 51 calls the program code stored in the memory 54 for performing any of the above-mentioned method steps.
The communication bus 52 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 52 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 9, but this does not indicate only one bus or one type of bus.
The memory 54 may include a volatile memory (RAM), such as a random-access memory (RAM); the memory may also include a non-volatile memory (english: non-volatile memory), such as a flash memory (english: flash memory), a hard disk (english: hard disk drive, abbreviated: HDD) or a solid-state drive (english: SSD); the memory 54 may also comprise a combination of the above types of memories.
The processor 51 may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of a CPU and an NP.
The processor 51 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
Optionally, the memory 54 is also used to store program instructions. The processor 51 may call program instructions to implement a data processing method as shown in any of the embodiments of the present application.
An embodiment of the present invention further provides a non-transitory computer storage medium, where a computer-executable instruction is stored in the computer storage medium, and the computer-executable instruction can execute the data processing method in any of the above method embodiments. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD), a Solid State Drive (SSD), or the like; the storage medium may also comprise a combination of memories of the kind described above.
Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope defined by the appended claims.

Claims (10)

1. A data processing method, comprising:
acquiring a message to be processed, wherein the message to be processed comprises a device type and an identifier of target equipment;
distributing the message to be processed to a corresponding service processing module for processing based on the equipment type;
and distributing the processing result of the service processing module to a corresponding interface module for processing based on the equipment type and the identification so as to send the processing result to the target equipment.
2. The method according to claim 1, wherein the distributing the processing result of the service processing module to a corresponding interface module for processing based on the device type and the identifier, so as to send the processing result to the target device, includes:
acquiring a processing result of the service processing module;
calling a target process to distribute the processing result to an interface module corresponding to the equipment type, and processing a data protocol and a data format on the processing result by using the interface module;
and sending the processing result of the interface module to the target equipment based on the identification.
3. The method according to claim 1, wherein the interface module includes a service sub-module and an adaptation sub-module, and the distributing the processing result of the service processing module to the corresponding interface module for processing based on the device type and the identifier so as to send the processing result to the target device includes:
determining a corresponding target service sub-module based on the equipment type, and distributing a processing result of the business processing module to the target service sub-module;
acquiring and determining at least one adaptation submodule corresponding to the target service submodule according to the corresponding relation between the service submodule and the adaptation submodule;
determining a target adaptation sub-module corresponding to the target equipment from the at least one adaptation sub-module according to the identification and a pre-established one-to-one correspondence relationship between the adaptation sub-modules and the equipment;
and distributing the processing result of the business processing module to the corresponding target adapter module for processing based on the target service sub-module so as to send the processing result of the target adapter sub-module to the target equipment.
4. The method according to claim 3, wherein the service sub-modules include a master service sub-module and at least one slave service sub-module, and the obtaining and determining at least one adapter sub-module corresponding to the target service sub-module according to the correspondence between the service sub-module and the adapter sub-module includes:
the main service sub-module acquires a registration request sent by an adapter sub-module corresponding to the equipment;
the main service sub-module determines whether the registration request carries the identifier of the adaptation sub-module;
when the identifier of the adaptation submodule is not carried, determining that the adaptation submodule corresponding to the equipment is a newly registered adaptation submodule and distributing a corresponding identifier for the adaptation submodule corresponding to the equipment, and establishing a corresponding relation between the service submodule and the adaptation submodule corresponding to the equipment based on a corresponding relation between the main service submodule and the at least one slave service submodule;
and determining at least one adaptation sub-module corresponding to the target service sub-module based on the corresponding relation.
5. The method of claim 3, wherein the obtaining the correspondence between the service sub-module and the adaptor sub-module further comprises:
when the service submodule receives connection requests sent by at least two adapter submodules, the service submodule determines whether the connection requests come from the same equipment or not based on the identification of the adapter submodules;
when the connection request is from the same device, the service submodule responds only to the earliest connection request.
6. The method according to any one of claims 1-5, further comprising:
acquiring to-be-processed data sent by the target equipment based on an interface module corresponding to the equipment type, wherein the to-be-processed data comprises the equipment type of the target equipment and the identification of a target user;
distributing the processing result of the interface module to a corresponding service processing module for processing based on the equipment type;
and sending the processing result of the service processing module to the target user based on the identification of the target user.
7. The method according to claim 6, wherein the distributing the processing result of the interface module to the corresponding service processing module for processing based on the device type includes:
processing a data protocol and a data format of the data to be processed by using an interface module corresponding to the equipment type;
and calling a target process to distribute the processing result of the interface module to a service processing module corresponding to the equipment type for processing.
8. A data processing apparatus, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a message to be processed, and the message to be processed comprises the device type and the identifier of target equipment;
the distribution unit is used for distributing the message to be processed to the corresponding service processing module for processing based on the equipment type;
and the processing unit is used for distributing the processing result of the service processing module to the corresponding interface module for processing based on the equipment type and the identification so as to send the processing result to the target equipment.
9. An electronic device, comprising:
a memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the data processing method of any one of claims 1 to 7.
10. A computer-readable storage medium storing computer instructions for causing a computer to perform the data processing method of any one of claims 1 to 7.
CN202111138435.9A 2021-09-27 2021-09-27 Data processing method and device, electronic equipment and storage medium Pending CN113794652A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111138435.9A CN113794652A (en) 2021-09-27 2021-09-27 Data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111138435.9A CN113794652A (en) 2021-09-27 2021-09-27 Data processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113794652A true CN113794652A (en) 2021-12-14

Family

ID=78877274

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111138435.9A Pending CN113794652A (en) 2021-09-27 2021-09-27 Data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113794652A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114338526A (en) * 2022-01-06 2022-04-12 上海幻电信息科技有限公司 Data transmission method and device
CN115022403A (en) * 2022-07-07 2022-09-06 中航信移动科技有限公司 Information processing system for multi-channel service agent
CN115695549A (en) * 2022-10-27 2023-02-03 武汉方舟拓海科技有限公司 Software architecture, terminal equipment and application method of software architecture

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102664756A (en) * 2012-04-24 2012-09-12 北京星网锐捷网络技术有限公司 Device access method, device and system
CN105763346A (en) * 2014-12-15 2016-07-13 中兴通讯股份有限公司 Adaption subsystem and method for realizing network management data reporting
CN108881397A (en) * 2018-05-25 2018-11-23 沈阳东软医疗系统有限公司 Method, apparatus, equipment and the storage medium of Medical Devices processing information
US20190079808A1 (en) * 2017-09-14 2019-03-14 Ryoji Araki Information processing device, information processing system, and information processing method
US20190286809A1 (en) * 2018-03-15 2019-09-19 Ryoji Araki Information processing system, apparatus, and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102664756A (en) * 2012-04-24 2012-09-12 北京星网锐捷网络技术有限公司 Device access method, device and system
CN105763346A (en) * 2014-12-15 2016-07-13 中兴通讯股份有限公司 Adaption subsystem and method for realizing network management data reporting
US20190079808A1 (en) * 2017-09-14 2019-03-14 Ryoji Araki Information processing device, information processing system, and information processing method
US20190286809A1 (en) * 2018-03-15 2019-09-19 Ryoji Araki Information processing system, apparatus, and method
CN108881397A (en) * 2018-05-25 2018-11-23 沈阳东软医疗系统有限公司 Method, apparatus, equipment and the storage medium of Medical Devices processing information

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114338526A (en) * 2022-01-06 2022-04-12 上海幻电信息科技有限公司 Data transmission method and device
CN115022403A (en) * 2022-07-07 2022-09-06 中航信移动科技有限公司 Information processing system for multi-channel service agent
CN115022403B (en) * 2022-07-07 2022-12-13 中航信移动科技有限公司 Information processing system for multi-channel service agent
CN115695549A (en) * 2022-10-27 2023-02-03 武汉方舟拓海科技有限公司 Software architecture, terminal equipment and application method of software architecture

Similar Documents

Publication Publication Date Title
US10841336B2 (en) Selectively providing mutual transport layer security using alternative server names
US10089106B2 (en) Communications network, computer architecture, computer-implemented method and computer program product for development and management of femtocell-based applications
US11625281B2 (en) Serverless platform request routing
US10516565B2 (en) Transformation and transmission of event messages
CN113794652A (en) Data processing method and device, electronic equipment and storage medium
US11928522B2 (en) Containerized VNF deployment method and related device
CN113722077A (en) Data processing method, system, related device, storage medium and product
CN112104754A (en) Network proxy method, system, device, equipment and storage medium
CN115378944B (en) Network system, service grid configuration method, storage medium and electronic equipment
WO2023056713A1 (en) Cloud platform binding method and system for internet of things card, and device and medium
CN112860462A (en) Method, device and system for realizing interconnection and intercommunication of IOT platform bases
US11595471B1 (en) Method and system for electing a master in a cloud based distributed system using a serverless framework
CN107404410B (en) Method and device for constructing virtual network function platform in cloud environment
CN113810448B (en) Cloud service method, deployment method, device, electronic equipment and storage medium
CN114070889A (en) Configuration method, traffic forwarding method, device, storage medium, and program product
US10896077B2 (en) Messaging abstraction layer for integration with message oriented middleware platforms
CN116668467A (en) Resource access method and device, cloud hosting system and electronic equipment
KR102232951B1 (en) Back-end service platform device
US20230315541A1 (en) Tightly coupled parallel applications on a serverless computing system
WO2024034057A1 (en) Network management device, network management method, and program
US20230315543A1 (en) Tightly coupled parallel applications on a serverless computing system
CN115225637A (en) Cloud data display method and device, storage medium and electronic equipment
US20120054319A1 (en) Efficient response of common information model (cim) server
CN115756906A (en) Marketing mobile service method based on micro-service architecture
CN117955981A (en) Data processing method, device, equipment and storage medium

Legal Events

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