CN111540190B - Data distribution method and device based on double-core intelligent electric meter and computer equipment - Google Patents

Data distribution method and device based on double-core intelligent electric meter and computer equipment Download PDF

Info

Publication number
CN111540190B
CN111540190B CN202010643261.0A CN202010643261A CN111540190B CN 111540190 B CN111540190 B CN 111540190B CN 202010643261 A CN202010643261 A CN 202010643261A CN 111540190 B CN111540190 B CN 111540190B
Authority
CN
China
Prior art keywords
data
address
sent
double
electric meter
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.)
Active
Application number
CN202010643261.0A
Other languages
Chinese (zh)
Other versions
CN111540190A (en
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.)
Southern Power Grid Digital Grid Research Institute Co Ltd
Original Assignee
Southern Power Grid Digital Grid Research Institute 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 Southern Power Grid Digital Grid Research Institute Co Ltd filed Critical Southern Power Grid Digital Grid Research Institute Co Ltd
Priority to CN202010643261.0A priority Critical patent/CN111540190B/en
Publication of CN111540190A publication Critical patent/CN111540190A/en
Application granted granted Critical
Publication of CN111540190B publication Critical patent/CN111540190B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08CTRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
    • G08C19/00Electric signal transmission systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes

Abstract

The application relates to a data distribution method and device based on a double-core intelligent electric meter, computer equipment and a storage medium. The method comprises the steps of receiving data to be sent by a sending end through a virtual bus, determining a target address of the data to be sent according to the type of the data to be sent, then obtaining a named pipeline corresponding to the target address, using the named pipeline as a target pipeline, sending the data to be sent to a corresponding receiving end through the target pipeline through the virtual bus, wherein the named pipeline can realize communication between the receiving end and the virtual bus, and the named pipeline can correspond to the receiving end one by one. Compared with the traditional mode that the whole meter needs to be replaced to increase the service interface for sending data, the virtual bus, each receiving end and each sending end in the scheme carry out data distribution through the named pipelines, the data distribution requirements of the double-core electric meter can be met, and the effect of reducing the data distribution cost of the double-core intelligent electric meter is achieved.

Description

Data distribution method and device based on double-core intelligent electric meter and computer equipment
Technical Field
The application relates to the technical field of data processing, in particular to a data distribution method and device based on a double-core intelligent electric meter, computer equipment and a storage medium.
Background
The electric energy meter is an important device in the electric power system, and in the operation process of the electric power system, the electric energy meter undertakes the tasks of electric energy data acquisition, communication, electric energy data processing and the like. At present, only one chip is used for realizing the metering service function in the traditional electric energy meter, the software of the traditional electric energy meter is generally designed in an integrated mode, the software is solidified in the electric energy meter hardware, the software cannot be upgraded, the new application expansion is not supported, and the data distribution method is only suitable for an integrated software architecture. The continuous release of the IR46 standard and the corresponding domestic standard is implemented, and the double-core intelligent electric meter consisting of the metering core and the management core becomes the development direction of the next generation electric meter. The dual-core intelligent ammeter management core introduces an embedded operating system so as to realize flexible extension of advanced application. Therefore, an embedded operating system based on a management core is needed, and according to the data identification of the communication protocol of the electric energy meter, high-efficiency, high-frequency and real-time data distribution in management core software is realized, and meanwhile, data distribution of expanding application and expanding brand new data identification is supported. The traditional electric energy meter data distribution method is not suitable for a brand-new hardware architecture and software architecture, the dual-core intelligent electric meter needs to interact with more and more extended applications and distribute data, and a severe challenge is provided for the dual-core intelligent electric meter with an integrated design at present.
Therefore, the data distribution method of the existing electric energy meter cannot adapt to the data distribution requirement of the double-core intelligent electric meter.
Disclosure of Invention
In view of the above, it is necessary to provide a data distribution method, apparatus, computer device and storage medium capable of adapting to the dual-core smart meter.
A data distribution method based on a two-core smart meter, the method comprising:
receiving data to be sent by a sending end through a virtual bus; the sending end comprises services in the double-core intelligent electric meter and/or applications related to the double-core intelligent electric meter;
determining a target address of the data to be sent according to the type of the data to be sent;
acquiring a named pipeline corresponding to the target address as a target pipeline;
transmitting the data to be transmitted to a corresponding receiving end through the target pipeline through a virtual bus;
the named pipeline is used for realizing communication between the receiving end and the virtual bus; the named pipelines correspond to the receiving ends one by one; the receiving end comprises services in the double-core intelligent electric meter and/or applications related to the double-core intelligent electric meter.
In one embodiment, the types include reply data and request data;
the determining the target address of the data to be sent according to the type of the data to be sent includes:
if the type of the data to be sent is reply data, taking a first address carried by the reply data as the target address;
if the type of the sending data is request data, taking a second address carried by the request data as the target address;
the reply data is data responding to the corresponding request data; the request data is data uploaded by the sending end through a virtual bus.
In one embodiment, the method further comprises the following steps:
establishing a named pipeline corresponding to the virtual bus and a service in the dual-core intelligent electric meter and/or an application associated with the dual-core intelligent electric meter; the named pipelines comprise a reading pipeline and a writing pipeline;
the reading pipeline is used for receiving data sent by services in each double-core intelligent electric meter and/or applications related to the double-core intelligent electric meters;
the write pipeline is used for sending data to a service in each double-core intelligent electric meter and/or an application related to the double-core intelligent electric meter.
In one embodiment, before determining the target address of the data to be sent according to the type of the data to be sent, the method further includes:
judging whether the target address carried in the data to be sent is complete or not;
if the target address is complete, determining the type as the reply data;
and if the target address is not complete, determining the type as the request data.
In one embodiment, after the taking the first address carried by the reply data as the target address, the method further includes:
acquiring a sending end address carried in the reply data as the first address;
and returning the reply data to the sending end corresponding to the first address through the named pipeline corresponding to the sending end.
In one embodiment, after the taking the second address carried by the request data as the target address, the method further includes:
determining the address of a receiving end corresponding to the request data according to the data identification carried in the request data;
when the determination is successful, taking the determined address of the receiving end as the second address;
when the determination fails, determining the address of a receiving end corresponding to the request data according to a control code carried in the request data and a plurality of data identifications, and taking the determined address of the receiving end as the second address;
and sending the request data to a receiving end corresponding to the second address through a named pipeline corresponding to the receiving end.
In one embodiment, the method further comprises the following steps:
and when determining that the address determination of the receiving end corresponding to the request data fails according to the control code carried in the request data and the plurality of data identifiers, performing on-demand polling or broadcasting the request data to the service in each double-core intelligent electric meter corresponding to the named pipeline and/or the application associated with the double-core intelligent electric meter.
In one embodiment, after the sending the request data to the receiving end corresponding to the second address through the named pipe corresponding to the receiving end, the method further includes:
acquiring response data sent by the receiving end;
and forwarding the response data to the transmitting end corresponding to the second address.
A data distribution apparatus based on a two-core smart electric meter, the apparatus comprising:
the receiving module is used for receiving data to be sent by the sending end through the virtual bus; the sending end comprises services in the double-core intelligent electric meter and/or applications related to the double-core intelligent electric meter;
a determining module, configured to determine a target address of the data to be sent according to the type of the data to be sent;
the acquisition module is used for acquiring the named pipeline corresponding to the target address as a target pipeline;
the sending module is used for sending the data to be sent to a corresponding receiving end through the target pipeline through a virtual bus; the named pipeline is used for realizing communication between the receiving end and the virtual bus; the named pipelines correspond to the receiving ends one by one; the receiving end comprises services in the double-core intelligent electric meter and/or applications related to the double-core intelligent electric meter.
A computer device comprising a memory storing a computer program and a processor implementing the steps of the method described above when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method.
According to the data distribution method and device based on the double-core smart electric meter, the computer equipment and the storage medium, the data to be sent by the sending end is received through the virtual bus, the target address of the data to be sent is determined according to the type of the data to be sent, the named pipeline corresponding to the target address is obtained and used as the target pipeline, the data to be sent is sent to the corresponding receiving end through the target pipeline through the virtual bus, the named pipeline can achieve communication between the receiving end and the virtual bus, and the named pipeline can correspond to the receiving end one by one. Compared with the traditional mode that the whole meter needs to be replaced to increase the service interface for sending data, the virtual bus, each receiving end and each sending end in the scheme carry out data distribution through the named pipelines, the data distribution requirements of the double-core electric meter can be met, and the effect of reducing the data distribution cost of the double-core intelligent electric meter is achieved.
Drawings
FIG. 1 is a diagram of an application environment of a data distribution method based on a two-core smart meter in one embodiment;
FIG. 2 is a schematic flow chart of a data distribution method based on a two-core smart electric meter in one embodiment;
FIG. 3 is a timing diagram of the data distribution step in one embodiment;
FIG. 4 is a schematic flow chart of a data distribution method based on a two-core smart electric meter in another embodiment;
FIG. 5 is a block diagram of a data distribution device based on a two-core smart meter according to an embodiment;
FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The data distribution method based on the double-core intelligent electric meter can be applied to the application environment shown in fig. 1. The two-core smart meter 100 may include therein a virtual bus 102 and several applications and services. The virtual bus 102 may communicate with various services and applications in the two-core smart meter through named pipes. The services and the applications in the dual-core smart meter may communicate with each other, and include a first service 104, a second service 106, a third service 108, a fourth service 110, and a plurality of fifth services 112, specifically, the first service 104 may be a communication management service, the second service 106 may be a basic application, the third service 108 may be a platform management service, the fourth service 110 may be a metering management service, and the plurality of fifth services 112 may be a plurality of extended applications, and the like, and the applications and the services may serve as a receiving end or a sending end. The two-core smart meter 100 may receive data to be sent by a sending end through the virtual bus 102, determine a target address of the data to be sent according to a type of the data to be sent, and send the data to be sent to a corresponding receiving end through the virtual bus 102 after acquiring a named pipeline corresponding to the target address as a target pipeline. The virtual bus 102 may be made up of one or more components, among others. In an embodiment, the application may also be an application that is located outside the two-core smart meter and performs data communication with the two-core smart meter through an interface of the two-core smart meter.
In one embodiment, as shown in fig. 2, a data distribution method based on a two-core smart meter is provided, which is illustrated by taking the two-core smart meter 100 in fig. 1 as an example, and includes the following steps:
step S202, receiving data to be sent from a sending end through a virtual bus 102; the transmitting end includes a service in the dual-core smart meter 100 and/or an application associated with the dual-core smart meter 100.
The data to be sent may be data sent by the service and the application in the dual-core smart meter 100 to the virtual bus 102, where the data needs to be sent to the corresponding receiving end through the virtual bus 102, and the virtual bus 102 may receive data transmitted by a plurality of applications and services, as the data to be sent, where the applications and the services may be used as a sending end, that is, the sending end may include the service in the dual-core smart meter 100, and may also include an application associated with the dual-core smart meter 100.
Step S204, according to the type of the data to be sent, determining the target address of the data to be sent.
The data to be sent may be data received through the virtual bus 102, where the data may be sent by a service in the dual-core smart meter 100, or may be sent to the virtual bus 102 by an application associated with the dual-core smart meter 100, where the application associated with the dual-core smart meter 100 may be an application inside the dual-core smart meter 100, or an application outside the dual-core smart meter 100, and the application outside the dual-core smart meter 100 may perform communication data transmission with the dual-core smart meter 100 through a corresponding interface of the dual-core smart meter 100. The data to be sent may include multiple types, for example, reply data, or request data, where the request data may be data uploaded by the sending end through the virtual bus 102, the reply data may be data in which the receiving end of the request data responds to the request data, where the sending end and the receiving end may be services in the dual-core smart meter 100, such as communication management services, platform management services, metering management services, and the like, or may be applications associated with the dual-core smart meter 100, such as a basic application and multiple extended applications, the applications may be located in the dual-core smart meter 100, or may be applications outside the dual-core smart meter 100, and the applications outside the dual-core smart meter 100 may perform communication data transmission with the dual-core smart meter 100 through corresponding interfaces of the dual-core smart meter 100. The dual-core smart meter 100 may determine the target address of the data to be sent according to the type of the data to be sent, that is, the determination manners of the target addresses of the reply data and the request data may be different. The target address may be an address corresponding to the receiving end to which the data to be sent needs to be sent.
Step S206, acquiring the named pipeline corresponding to the target address as the target pipeline.
The target address may be an address corresponding to a receiving end to which the data to be sent needs to be sent, the target address may be determined in different manners according to different types of the data to be sent, the named pipe may be an inter-process communication mechanism, and may support reliable, unidirectional, or bidirectional data communication between different applications or services of the same two-core smart meter 100 or between different applications of different two-core smart meters 100, and the named pipe may be used to implement communication between the receiving end and the virtual bus 102; named pipes may correspond one-to-one with the receiving ends. The two-core smart meter 100 may obtain, as a target pipe, a named pipe corresponding to the target address according to the target address of the data to be sent, where the target pipe may be a named pipe used by the two-core smart meter 100 to send the data to be sent to a receiving end, where there are multiple named pipes and multiple target pipes, and the multiple named pipes and the target pipes may implement communication between the receiving end and the sending end and the virtual bus 102.
Step S208, the data to be sent is sent to the corresponding receiving end through the target pipeline via the virtual bus 102.
The receiving end may include services in the dual-core smart meter 100, or applications associated with the dual-core smart meter 100, for example, the communication management service, the basic application, the platform management service, the metering management service, a plurality of extended applications, and the like, the applications may be located in the dual-core smart meter 100, or may be applications outside the dual-core smart meter 100, and the applications outside the dual-core smart meter 100 may perform communication data transmission with the dual-core smart meter 100 through a corresponding interface of the dual-core smart meter 100. The target pipelines, namely named pipelines corresponding to target addresses, may correspond to the receiving ends one to one, and the target pipelines may be determined according to addresses of data to be sent. The dual-core smart meter 100 may transmit the data to be transmitted to a corresponding receiving end through the target pipeline via a virtual bus. In addition, the named pipes may not correspond to the receiving ends one to one, and for example, a plurality of named pipes may correspond to one receiving end.
According to the data distribution method based on the double-core intelligent ammeter, data to be sent by a sending end is received through a virtual bus, a target address of the data to be sent is determined according to the type of the data to be sent, a named pipeline corresponding to the target address is obtained and used as a target pipeline, the data to be sent is sent to a corresponding receiving end through the target pipeline through the virtual bus, the named pipeline can achieve communication between the receiving end and the virtual bus, and the named pipeline can correspond to the receiving end one to one. Compared with the traditional mode that the whole meter needs to be replaced to increase the service interface for sending data, the virtual bus, each receiving end and each sending end in the scheme carry out data distribution through the named pipelines, the data distribution requirements of the double-core electric meter can be met, and the effect of reducing the data distribution cost of the double-core intelligent electric meter is achieved.
In an embodiment, the type of the data to be sent includes reply data and request data; determining a target address of data to be sent according to the type of the data to be sent, wherein the determining comprises the following steps: if the type of the data to be sent is reply data, taking a first address carried by the reply data as a target address; and if the type of the transmitted data is request data, taking a second address carried by the request data as a target address.
In this embodiment, the data to be sent may be data that is sent to the virtual bus 102 by each sending end and needs to be sent to a corresponding receiving end, and the data to be sent may include multiple types, for example, the type of the data to be sent may be reply data or request data. The reply data may be data responding to the request data, the request data may be data uploaded by the sending end through the virtual bus 102, and the target address may be an address corresponding to a receiving end to which the data to be sent needs to be sent. The target address to which the data to be sent needs to be sent can be determined according to the type of the data to be sent. Specifically, if the dual-core smart meter 100 detects that the type of the data to be sent is the reply data through the virtual bus 102, it indicates that a target address of the reply data is already clear, that is, the source address is a source address corresponding to a sending end of the request data corresponding to the reply data, the dual-core smart meter 100 may use the source address as the first address, that is, the target address, and the dual-core smart meter 100 may determine whether the target address of the data to be sent is clear through a virtualbus _ distribution _ data _ control function; the two-core smart meter 100 determines that the data to be sent is request data, which indicates that a target address of the data to be sent is ambiguous, at this time, the two-core smart meter 100 may use a second address of the request data as the target address, specifically, the request data may carry a data identifier and may also carry a control code, the two-core smart meter 100 may determine the second address according to the data identifier in the request data, may also determine the second address according to the control code, and may also determine the second address according to the data identifier and the control code, thereby determining the target address.
Through this embodiment, the twin-core smart meter 100 can determine the target address in different ways according to the different types of data to be sent, and compared with the conventional way that the whole meter needs to be replaced to send different types of data, this embodiment adapts to the data distribution requirement of the twin-core smart meter, and also realizes the effect of reducing the data distribution cost of the twin-core smart meter.
In one embodiment, further comprising: establishing a named pipe corresponding to the virtual bus 102 and a service in the two-core smart meter 100 and/or an application associated with the two-core smart meter; named pipes include read pipes and write pipes; the reading pipeline is used for receiving data sent by the service in each two-core intelligent electric meter 100 and/or the application related to the two-core intelligent electric meter; the write pipe is used to send data to services in each two-core smart meter 100 and/or applications associated with the two-core smart meter.
In this embodiment, the named pipe may be an inter-process communication mechanism, and may support reliable, unidirectional, or bidirectional data communication between different applications or services of the same two-core smart meter 100 or between different applications of different two-core smart meters 100, and may be used to implement communication between the receiving end and the virtual bus 102; named pipes may correspond one-to-one with the receiving ends. The named pipe may be a pair of pipes and may include a read pipe and a write pipe, wherein the read pipe may be a pipe used by the two-core smart meter 100 to receive data from the pipe through the virtual bus 102, for example, data from a service in the two-core smart meter 100 may be received through the virtual bus 102, and data from an application associated with the two-core smart meter 100 may also be received; the write pipe may be a pipe through which the two-core smart meter 100 transmits data through the virtual bus 102, for example, the virtual bus 102 may be used to distribute data to a service in the two-core smart meter 100 through the write pipe, or may be transmitted to an application associated with the two-core smart meter 100. The application can be installed in the dual-core intelligent electric meter 100, and also can be installed in the external equipment of the dual-core intelligent electric meter, and the dual-core intelligent electric meter 100 is communicated with the external interface of the dual-core intelligent electric meter 100. The two-core intelligent electric meter 100 can establish a pair of named pipelines with the applications and the services through the virtual bus 102 respectively, the named pipelines can be in one-to-one-way communication, one end of each pipeline is only written, and the other end of each pipeline is only read; in addition, the same process pipe can only be opened once in a read-only and write-only manner. The virtual bus 102 may also create a snoop thread that may be used to snoop and receive data sent by the above-described applications and services onto the virtual bus 102.
Through the embodiment, the two-core smart electric meter 100 can create a named pipeline one-to-one with the application and service through the virtual bus 102 to receive or write data, and compared with a traditional mode that the whole meter needs to be replaced to send data of different types of interfaces, the scheme can adapt to the data distribution requirement of the two-core smart electric meter, and the effect of reducing the data distribution cost of the two-core smart electric meter is also achieved.
In an embodiment, before determining a target address of data to be sent according to a type of the data to be sent, the method further includes: judging whether a target address carried in data to be sent is complete or not; if the target address is complete, determining the type as the reply data; and if the target address is not complete, determining the type as the request data.
In this embodiment, the data to be sent may be data received through the virtual bus 102, and the data may be sent through a reading pipe in the named pipe by a service in the dual-core smart meter 100, or may be sent to the virtual bus 102 through a reading pipe in the named pipe by an application associated with the dual-core smart meter 100, where the application associated with the dual-core smart meter 100 may be an application inside the dual-core smart meter 100, or an application outside the dual-core smart meter 100, and the application outside the dual-core smart meter 100 may perform communication data transmission with the dual-core smart meter 100 through a corresponding interface of the dual-core smart meter 100. The destination address may be an address of a receiving end to which the data to be sent needs to be sent. The virtual bus 102 in the dual-core smart meter 100 may receive the data to be sent, and determine the type and address of the data to be sent by analyzing the distribution function. Specifically, the virtual bus 102 may perform target address integrity judgment after receiving the data to be sent, and if the target address is definite, that is, the target address is complete, the virtual bus 102 may determine that the type of the data to be sent is the reply data, and if the target address is indefinite, that is, the target address is incomplete, the virtual bus 102 may determine that the type of the data to be sent is the request data. In addition, when the virtual bus 102 determines that the data to be sent is the request data, the data can be distributed according to the data identifier of the request data, so as to obtain the explicit target address of the request data.
Through this embodiment, the two-core smart meter 100 can determine the type of the data to be sent according to the integrity of the target address of the data to be sent by using the virtual bus 102, so that the sending mode of the data to be sent can be determined quickly, and the data distribution efficiency of the two-core smart meter is improved.
In one embodiment, after the first address carried by the reply data is taken as the target address, the method further includes: acquiring a sending end address carried in the reply data as a first address; and returning the reply data to the sending end corresponding to the first address through the named pipeline corresponding to the sending end.
In this embodiment, the reply data may be one of the data to be sent, and the reply data may be data that the receiving end of the request data responds to the request data. The dual-core smart meter 100 may determine the type of the data to be sent through the virtual bus 102, where the reply data carries a complete target address, that is, the first address, and specifically, the target address may be an address of a sending end of the request data corresponding to the reply data, that is, a source address of the reply data. The virtual bus 102 of the two-core smart meter 100 may perform data transmission with the sending end through a named pipe, that is, the virtual bus 102 in the two-core smart meter 100 may return the reply data to the sending end of the request data corresponding to the reply data through the named pipe corresponding to the sending end.
Through the embodiment, the virtual bus 102 in the dual-core smart electric meter 100 can return the reply data to the sending end corresponding to the carried target address in a manner of naming a pipeline when the data to be sent is judged to be the reply data, and compared with a conventional manner that the whole meter needs to be replaced to send data of different interfaces, the scheme can adapt to the data distribution requirement of the dual-core smart electric meter, and the effect of reducing the data distribution cost of the dual-core smart electric meter is also achieved.
In one embodiment, as shown in FIG. 3, FIG. 3 is a timing diagram of the data distribution step in one embodiment. After the second address carried by the request data is taken as the target address, the method further comprises the following steps: determining the address of a receiving end corresponding to the request data according to the data identification carried in the request data; when the determination is successful, taking the determined address of the receiving end as a second address; when the determination fails, determining the address of a receiving terminal corresponding to the request data according to the control code and the plurality of data identifiers carried in the request data, and taking the determined address of the receiving terminal as a second address; and sending the request data to a receiving end corresponding to the second address through a named pipeline corresponding to the receiving end.
In this embodiment, the request data may be data uploaded by the sending terminal through the virtual bus 102, the sending terminal may include services in the dual-core smart meter 100, and may further include applications associated with the dual-core smart meter 100, specifically, a basic application, a metering management service, a platform management service, a communication management service, and the like in the dual-core smart meter 100, or a plurality of extended applications installed in the dual-core smart meter 100, or in a device associated with the dual-core smart meter 100, where the plurality of extended applications installed in the device associated with the dual-core smart meter 100 may communicate with the dual-core smart meter 100 through an external interface of the dual-core smart meter 100. The data identifier may be an identifier carried in the request data, and may be used to determine a second address, i.e., a target address, of the request data. Specifically, the two-core smart meter 100 may determine, through a data identifier carried in the request data, for example, the data identifier DI3, an address of a receiving end corresponding to the request data, that is, may perform primary data distribution on the request data, and when a destination address may be determined according to the data identifier DI3, the virtual bus 102 may send the request data to the corresponding receiving end through a named pipe corresponding to the destination address. When the virtual bus 102 in the two-core smart meter 100 cannot determine the destination address according to the data identifier DI3, the virtual bus 102 may also determine the address of the receiving end of the request data as the second address, i.e., the destination address, according to the control code of the request data and the data identifiers. Specifically, when the virtual bus 102 cannot determine the destination address according to the primary data distribution, the destination address of the request data may be determined according to 645 frame control codes and a combination of multiple data identifiers, for example, a combination of DI0 and DI 3.
In another embodiment, when the address determination of the receiving end corresponding to the request data fails according to the control code and the plurality of data identifications carried in the request data, the request data are polled or broadcast on demand to the service in each dual-core smart meter corresponding to the named pipeline and/or the application associated with the dual-core smart meter.
In this embodiment, the on-demand polling may be a data distribution form, that is, the virtual bus 102 may initiate a data distribution request to each named pipe at intervals; the broadcast may be another form of data distribution, i.e., the virtual bus 102 may distribute the data into each named pipe. When the virtual bus 102 determines that the address determination of the receiving end corresponding to the request data fails according to the control code and the plurality of data identifiers carried in the request data, that is, when the secondary data distribution fails, the request data may be sent to each named pipe in the on-demand polling or broadcasting manner, so that the receiving end meeting the requirement may receive the request data.
In another embodiment, after sending the request data to the receiver corresponding to the second address through the named pipe corresponding to the receiver, the method further includes: acquiring response data sent by a receiving end; and forwarding the response data to the transmitting end corresponding to the second address.
In this embodiment, the response data may be data returned by the receiving end of the request data after receiving the request data. The virtual bus 102 may obtain response data generated by the receiving end for the request data received by the receiving end, and distribute the response data to the virtual bus 102 through the named channel to respond to the virtual bus 102; after receiving the response data sent by the receiving end, the virtual bus 102 may forward the response data back to the channel corresponding to the source address, that is, the channel corresponding to the sending end of the request data, so that the sending end corresponding to the request data may receive the response data.
Through the embodiment, the virtual bus 102 in the dual-core smart electric meter 100 can determine the target address and the sending mode of the request data in various ways, and when the target address cannot be determined, the request data can be sent in the on-demand polling and broadcasting way.
In one embodiment, as shown in fig. 4, fig. 4 is a schematic flowchart of a data distribution method based on a two-core smart meter in another embodiment. In this embodiment, the dual-core smart meter 100 may receive data through the virtual bus 102, and then call virtual bus _ distribution _ data _ control to determine whether a target address is determined, and when the target address is determined, the data may be sent to a named channel corresponding to a source address according to the source address of the data, where the named channel includes named channels of a first service, a second service, a third service, and a fourth service, specifically, the first service may be a communication management service, the second service may be a basic application, the third service may be a platform management service, and the fourth service may be a metering management service; when the data is determined successfully by the method, the data can be written into a corresponding named pipeline, so that the data is sent; when the data cannot be determined in this way, the destination address can be determined by combining a plurality of data identifications DI0 to DI3 and performing secondary data distribution in combination with the control code, and when the determination is successful in this way, the data can be written into the corresponding named pipe, so that the data can be transmitted; when the data is unsuccessful, the data can be transmitted by adopting an on-demand polling or direct broadcasting mode.
Through this embodiment, the two-core smart electric meter 100 can utilize the virtual bus 102 and the named pipes corresponding to the receiving ends, and determine the target address and the named pipe to be sent in different ways according to different data types of the data to be sent, so that the corresponding receiving end can receive the data sent by the virtual bus 102.
It should be understood that although the various steps in the flowcharts of fig. 2-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-4 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps or stages.
In one embodiment, as shown in fig. 5, there is provided a data distribution apparatus based on a two-core smart meter, including: a receiving module 500, a determining module 502, an obtaining module 504, and a sending module 506, wherein:
a receiving module 500, configured to receive, through a virtual bus, data to be sent from a sending end; the sending end comprises services in the double-core intelligent electric meter and/or applications related to the double-core intelligent electric meter.
The determining module 502 is configured to determine a target address of data to be sent according to a type of the data to be sent.
An obtaining module 504, configured to obtain a named pipe corresponding to the target address as a target pipe.
A sending module 506, configured to send data to be sent to a corresponding receiving end through a target pipeline via a virtual bus; the named pipeline is used for realizing communication between the receiving end and the virtual bus; the named pipelines correspond to the receiving ends one by one; receiving end comprises service in dual-core intelligent electric meter and/or application associated with dual-core intelligent electric meter
In an embodiment, the apparatus further includes a first determining module, configured to, if the type of the data to be sent is the reply data, use a first address carried by the reply data as a target address; if the type of the transmitted data is request data, taking a second address carried by the request data as a target address; the reply data is data responding to the corresponding request data; the request data is data uploaded by the sending end through the virtual bus.
In one embodiment, the apparatus further includes a pipe establishing module for establishing a named pipe corresponding to the virtual bus and a service in the two-core smart meter and/or an application associated with the two-core smart meter; named pipes include read pipes and write pipes; the reading pipeline is used for receiving service in each double-core intelligent electric meter and/or data sent by an application related to the double-core intelligent electric meter; the write pipe is used for sending data to a service in each two-core smart meter and/or an application associated with the two-core smart meter.
In an embodiment, the apparatus further includes a second determining module, configured to determine whether a target address carried in the data to be sent is complete; if the target address is complete, determining the type as the reply data; and if the target address is not complete, determining the type as the request data.
In an embodiment, the sending module 506 is specifically configured to obtain a sending end address carried in the reply data as a first address; and returning the reply data to the sending end corresponding to the first address through the named pipeline corresponding to the sending end.
In an embodiment, the sending module 506 is specifically configured to determine, according to a data identifier carried in the request data, an address of a receiving end corresponding to the request data; when the determination is successful, taking the determined address of the receiving end as a second address; when the determination fails, determining the address of a receiving terminal corresponding to the request data according to the control code and the plurality of data identifiers carried in the request data, and taking the determined address of the receiving terminal as a second address; and sending the request data to a receiving end corresponding to the second address through a named pipeline corresponding to the receiving end.
In an embodiment, the apparatus further includes a broadcasting module, configured to poll or broadcast the request data on demand to the service in each dual-core smart meter corresponding to the named pipe and/or the application associated with the dual-core smart meter when determining that the address determination of the receiving end corresponding to the request data fails according to the control code carried in the request data and the plurality of data identifiers.
In one embodiment, the apparatus further includes a return module, configured to obtain response data sent by the receiving end; and forwarding the response data to the transmitting end corresponding to the second address.
For specific limitations of the data distribution device based on the two-core smart meter, reference may be made to the above limitations of the data distribution method based on the two-core smart meter, and details are not repeated here. The modules in the data distribution device based on the two-core smart electric meter can be completely or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a two-core smart meter, the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing the data to be sent. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to realize a data distribution method based on the double-core intelligent electric meter.
Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, which includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the data distribution method based on the two-core smart electric meter.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the data distribution method based on a two-core smart electric meter as described above.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (11)

1. A data distribution method based on a double-core smart electric meter is characterized by comprising the following steps:
receiving data to be sent by a sending end through a virtual bus; the sending end comprises services in the double-core intelligent electric meter and/or applications related to the double-core intelligent electric meter;
determining a target address of the data to be sent according to the type of the data to be sent; the type includes request data; the request data is data uploaded by the sending end through a virtual bus;
if the type of the data to be sent is request data, taking a second address carried by the request data as the target address, including:
determining the address of a receiving end corresponding to the request data according to the data identification carried in the request data;
when the determination is successful, taking the determined address of the receiving end as the second address;
when the determination fails, determining the address of the receiving terminal corresponding to the request data according to the control code carried in the request data and the data identifier, and taking the determined address of the receiving terminal as the second address;
acquiring a named pipeline corresponding to the target address as a target pipeline;
transmitting the data to be transmitted to a corresponding receiving end through the target pipeline through a virtual bus;
the named pipeline is used for realizing communication between the receiving end and the virtual bus; the named pipelines correspond to the receiving ends one by one; the receiving end comprises services in the double-core intelligent electric meter and/or applications related to the double-core intelligent electric meter.
2. The method of claim 1, wherein the types further comprise reply data;
the determining the target address of the data to be sent according to the type of the data to be sent includes:
if the type of the data to be sent is reply data, taking a first address carried by the reply data as the target address; the reply data is data that responds to the corresponding request data.
3. The method of claim 1, further comprising:
establishing a named pipeline corresponding to the virtual bus and a service in the dual-core intelligent electric meter and/or an application associated with the dual-core intelligent electric meter; the named pipelines comprise a reading pipeline and a writing pipeline;
the reading pipeline is used for receiving data sent by services in each double-core intelligent electric meter and/or applications related to the double-core intelligent electric meters;
the write pipeline is used for sending data to a service in each double-core intelligent electric meter and/or an application related to the double-core intelligent electric meter.
4. The method according to claim 2, wherein before determining the target address of the data to be sent according to the type of the data to be sent, the method further comprises:
judging whether the target address carried in the data to be sent is complete or not;
if the target address is complete, determining the type as the reply data;
and if the target address is not complete, determining the type as the request data.
5. The method according to claim 2, wherein after the taking the first address carried by the reply data as the target address, further comprising:
acquiring a sending end address carried in the reply data as the first address;
and returning the reply data to the sending end corresponding to the first address through the named pipeline corresponding to the sending end.
6. The method of claim 2, wherein after the step of using the second address carried by the request data as the target address, the method further comprises:
and sending the request data to a receiving end corresponding to the second address through a named pipeline corresponding to the receiving end.
7. The method of claim 6, further comprising:
and when determining that the address determination of the receiving end corresponding to the request data fails according to the control code carried in the request data and the plurality of data identifiers, performing on-demand polling or broadcasting the request data to the service in each double-core intelligent electric meter corresponding to the named pipeline and/or the application associated with the double-core intelligent electric meter.
8. The method according to any one of claims 6 to 7, wherein after sending the request data to the receiver corresponding to the second address through the named pipe corresponding to the receiver, the method further comprises:
acquiring response data sent by the receiving end;
and forwarding the response data to the transmitting end corresponding to the second address.
9. A data distribution device based on a double-core smart electric meter is characterized by comprising:
the receiving module is used for receiving data to be sent by the sending end through the virtual bus; the sending end comprises services in the double-core intelligent electric meter and/or applications related to the double-core intelligent electric meter;
a determining module, configured to determine a target address of the data to be sent according to the type of the data to be sent; the type includes request data; the request data is data uploaded by the sending end through a virtual bus;
the first judging module is used for taking a second address carried by the request data as the target address if the type of the data to be sent is the request data; the method is specifically used for: determining the address of a receiving end corresponding to the request data according to the data identification carried in the request data; when the determination is successful, taking the determined address of the receiving end as the second address; when the determination fails, determining the address of the receiving terminal corresponding to the request data according to the control code carried in the request data and the data identifier, and taking the determined address of the receiving terminal as the second address;
the acquisition module is used for acquiring the named pipeline corresponding to the target address as a target pipeline;
the sending module is used for sending the data to be sent to a corresponding receiving end through the target pipeline through a virtual bus; the named pipeline is used for realizing communication between the receiving end and the virtual bus; the named pipelines correspond to the receiving ends one by one; the receiving end comprises services in the double-core intelligent electric meter and/or applications related to the double-core intelligent electric meter.
10. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 8.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 8.
CN202010643261.0A 2020-07-07 2020-07-07 Data distribution method and device based on double-core intelligent electric meter and computer equipment Active CN111540190B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010643261.0A CN111540190B (en) 2020-07-07 2020-07-07 Data distribution method and device based on double-core intelligent electric meter and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010643261.0A CN111540190B (en) 2020-07-07 2020-07-07 Data distribution method and device based on double-core intelligent electric meter and computer equipment

Publications (2)

Publication Number Publication Date
CN111540190A CN111540190A (en) 2020-08-14
CN111540190B true CN111540190B (en) 2020-11-03

Family

ID=71980865

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010643261.0A Active CN111540190B (en) 2020-07-07 2020-07-07 Data distribution method and device based on double-core intelligent electric meter and computer equipment

Country Status (1)

Country Link
CN (1) CN111540190B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111813699B (en) * 2020-09-01 2021-01-26 南方电网数字电网研究院有限公司 Data routing test method and device based on intelligent electric meter and computer equipment
CN112395012B (en) * 2020-11-03 2024-02-27 南方电网数字电网科技(广东)有限公司 Data emptying method and device based on double-core intelligent ammeter and computer equipment
CN112486886B (en) * 2020-12-09 2023-04-18 国网四川省电力公司电力科学研究院 Method for stable communication between double cores of double-core intelligent electric energy meter
CN112637355B (en) * 2020-12-25 2023-05-23 新天科技股份有限公司 Multi-concurrency single-channel based wireless data processing method, device, equipment and medium
CN113341215B (en) * 2021-05-06 2022-11-25 南方电网数字电网研究院有限公司 Double-core intelligent ammeter
CN113992470B (en) * 2021-10-14 2023-06-16 上海艾为电子技术股份有限公司 Data transmitting method, data receiving method, master device, slave device and electronic device
CN114238232B (en) * 2021-12-15 2024-04-02 南方电网电力科技股份有限公司 Intelligent ammeter file reading and writing system, method, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20090032486A (en) * 2007-09-28 2009-04-01 한국전력공사 System and method for electric power demand analysis by pattern analysis
CN102056097A (en) * 2009-11-09 2011-05-11 华为技术有限公司 Message sending method based on gateway and Parlay X gateway
CN102401848A (en) * 2010-09-08 2012-04-04 国基电子(上海)有限公司 Electricity meter and communication relaying method for same
CN104539661A (en) * 2014-12-11 2015-04-22 曙光信息产业(北京)有限公司 Message queue processing method and device
CN111343199A (en) * 2020-04-28 2020-06-26 南方电网数字电网研究院有限公司 Communication method and system of double-core intelligent electric meter

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106501599B (en) * 2016-10-17 2019-04-23 国家电网公司 Twin-core electric energy meter data exchange validity determines method and system and twin-core electric energy meter

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20090032486A (en) * 2007-09-28 2009-04-01 한국전력공사 System and method for electric power demand analysis by pattern analysis
CN102056097A (en) * 2009-11-09 2011-05-11 华为技术有限公司 Message sending method based on gateway and Parlay X gateway
CN102401848A (en) * 2010-09-08 2012-04-04 国基电子(上海)有限公司 Electricity meter and communication relaying method for same
CN104539661A (en) * 2014-12-11 2015-04-22 曙光信息产业(北京)有限公司 Message queue processing method and device
CN111343199A (en) * 2020-04-28 2020-06-26 南方电网数字电网研究院有限公司 Communication method and system of double-core intelligent electric meter

Also Published As

Publication number Publication date
CN111540190A (en) 2020-08-14

Similar Documents

Publication Publication Date Title
CN111540190B (en) Data distribution method and device based on double-core intelligent electric meter and computer equipment
CN111768608B (en) Data transmission method and device based on double-core intelligent electric meter and computer equipment
CN111583622B (en) Metering information distribution processing system and method of double-core intelligent ammeter management unit
US8224367B2 (en) Method and system for estimating station numbers in wireless communications
CN107332700B (en) Method and equipment for configuring wireless routing equipment
CN109743757B (en) Data processing method and device, wireless module and Internet of things equipment
CN111813699B (en) Data routing test method and device based on intelligent electric meter and computer equipment
CN111741143B (en) Method and device for on-line distribution of Modbus addresses of electrical measuring instrument
CN102984138B (en) A kind of methods, devices and systems obtaining object
US20180192448A1 (en) Method, device, and system for audio bluetooth pairing and connecting
CN104426858A (en) Information processing method and electronic equipment
CN112422485A (en) Communication method and device of transmission control protocol
CN115695077A (en) Bus data receiving method and device, electronic equipment and storage medium
CN114576828B (en) Communication management method, bifurcation box, multi-split air conditioning system and storage medium
CN112666389B (en) Double-core interaction method and device for double-core intelligent electric meter, double-core intelligent electric meter and medium
CN112866830B (en) Meter reading method and meter reading device
US9877355B2 (en) Wireless communicator connectable to different types of wireless communication networks
CN112950447B (en) Resource scheduling method, device, server and storage medium
CN113362196B (en) Low-delay addressing method for pre-dispatching service of power grid monitoring system
CN109862072B (en) Application task response method and device
CN111459819A (en) Software testing method and device, electronic equipment and computer readable medium
CN112437458B (en) Data transmission method, device, communication equipment and medium
WO2017118192A1 (en) Method and device for determining data transmission interval
CN116684913B (en) 4G communication module testing method, system, electronic equipment and storage medium
CN116151345B (en) Data transmission method, device, electronic 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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Room 86, room 406, No.1, Yichuang street, Zhongxin Guangzhou Knowledge City, Huangpu District, Guangzhou City, Guangdong Province

Applicant after: Southern Power Grid Digital Grid Research Institute Co.,Ltd.

Address before: 511458 Room 1301, Chengtou Building, 106 Fengze East Road, Nansha District, Guangzhou City, Guangdong Province (self-compiled 1301-12159)

Applicant before: Southern Power Grid Digital Grid Research Institute Co.,Ltd.

GR01 Patent grant
GR01 Patent grant