Disclosure of Invention
The invention provides a service agent method and device based on a block chain, which aim to solve the technical problem that the registration threshold is higher because the established block chain account needs to be communicated with the established block chain account in advance before a corresponding service is executed in the block chain in the prior art and the established block chain account is introduced into the block chain.
An embodiment of one aspect of the present invention provides a service agent method based on a block chain, where the method is applied to an EOS block chain, and includes: acquiring a service processing request which is sent by terminal equipment and carries an account identification code and a service identifier; detecting whether a service proxy authority of the account identification code exists or not according to a local proxy account; if the service agent authority with the account identification code is known, executing corresponding processing operation in the block chain according to the service identification; and receiving the processing result fed back by the block chain, and carrying out service response on the terminal equipment according to the processing result.
The service proxy method based on the block chain of the embodiment of the invention obtains a service processing request which is sent by a terminal device and carries an account identification code and a service identifier, detects whether the service proxy authority of the account identification code exists or not according to a local proxy account, executes corresponding processing operation in the block chain according to the service identifier if the service proxy authority of the account identification code exists, and finally receives a processing result fed back by the block chain and carries out service response on the terminal device according to the processing result. Therefore, the corresponding service can be executed in the block chain without registration, the registration threshold is reduced, the flexibility of the block chain is improved, and the popularization of the block chain is facilitated.
In addition, the service agent method based on the block chain in the embodiment of the present invention further includes the following additional technical features:
optionally, before the detecting whether the service agent authority has the account identification code according to the local proxy account, the method further includes: acquiring an agent request carrying a terminal identifier and sent by the terminal equipment, and generating the account identification code uniquely corresponding to the terminal identifier; and locally storing the account identification code, and feeding back the account identification code to the terminal equipment.
Optionally, before the detecting whether the service agent authority has the account identification code according to the local proxy account, the method further includes: and acquiring an agent request sent by the terminal equipment, and sending the account identification code to the terminal equipment according to the agent request, wherein the account identification code corresponds to a terminal identifier of a service agent terminal.
Optionally, the detecting whether the service agent authority has the account identification code according to the local agent account includes: and judging whether the account identification code is consistent with the terminal identification of the local computer.
Optionally, if the service agent permission with the account identification code is known, executing corresponding processing operations in the block chain according to the service identifier includes: extracting service content and a target block chain node according to the service identifier; and performing corresponding information interaction with the target block chain node according to the service content.
Another embodiment of the present invention provides a service agent apparatus based on a block chain, where the apparatus is applied to an EOS block chain, and includes: the first acquisition module is used for acquiring a service processing request which is sent by the terminal equipment and carries an account identification code and a service identifier; the detection module is used for detecting whether the service agent authority of the account identification code exists or not according to a local agent account; the service execution module is used for executing corresponding processing operation in the block chain according to the service identification if the service agent authority with the account identification code is acquired; and the service feedback module is used for receiving the processing result fed back by the block chain and carrying out service response on the terminal equipment according to the processing result.
The service agent device based on the block chain in the embodiment of the invention obtains a service processing request which is sent by a terminal device and carries an account identification code and a service identifier, detects whether the service agent device has the service agent authority of the account identification code according to a local agent account, executes corresponding processing operation in the block chain according to the service identifier if the service agent authority of the account identification code is obtained, and finally receives a processing result fed back by the block chain and carries out service response on the terminal device according to the processing result. Therefore, the corresponding service can be executed in the block chain without registration, the registration threshold is reduced, the flexibility of the block chain is improved, and the popularization of the block chain is facilitated.
In addition, the service agent device based on the block chain in the embodiment of the present invention further includes the following additional technical features:
optionally, the method further comprises: the second acquisition module is used for acquiring a proxy request carrying a terminal identifier and sent by the terminal equipment and generating the account identification code uniquely corresponding to the terminal identifier; and the first proxy module is used for locally storing the account identification code and feeding back the account identification code to the terminal equipment.
Optionally, the method further comprises: a third obtaining module, configured to obtain an agent request sent by the terminal device; and the second proxy module is used for sending the account identification code to the terminal equipment according to the proxy request, wherein the account identification code corresponds to the terminal identification of the service proxy terminal.
Another embodiment of the present invention provides an electronic device, including a processor and a memory; wherein the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the service brokering method based on the blockchain as described in the above embodiments.
A further embodiment of the present invention provides a non-transitory computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the service brokering method based on blockchain as described in the above embodiment.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
The service agent method and apparatus based on the block chain according to the embodiment of the present invention will be described with reference to the accompanying drawings.
Based on the technical problems mentioned in the background art that the block chain account registration threshold is high and the block chain popularization is affected, the embodiment of the invention provides a proxy method capable of executing a service in a block chain without registration. The block chain account is symbolic information of the block chain node, and can uniquely identify the block chain node.
Specifically, fig. 1 is a schematic flowchart of a service brokering method based on a block chain according to an embodiment of the present invention. As shown in fig. 1, the method includes:
step 101, acquiring a service processing request carrying an account identification code and a service identifier sent by a terminal device.
And 102, detecting whether the service agent authority has the account identification code according to the local agent account.
The account identification code can be understood as a proxy pass allocated to the service proxy terminal before, wherein the service proxy terminal is an account of a driving proxy function in a block chain account existing in a block chain and can be owned by a certain organization with higher authority, in addition, the service identification represents the service type and the service content to be executed, and the service proxy terminal can detect and effectively identify whether the service proxy terminal can proxy or not based on the service type, so that illegal or non-authority services can be filtered.
Specifically, when the terminal device has a service that needs to be executed in a block chain, a service processing request is sent to the proxy terminal, and after the service proxy terminal obtains the service processing request carrying an account identification code and a service identifier sent by the terminal device, whether the service proxy terminal has a service proxy authority of the account identification code or not is detected according to the proxy account, and whether the account identification code is a pass which is sent to the proxy terminal after the proxy terminal agrees to proxy before.
It should be noted that, in different application scenarios, the account id is different, which is exemplified as follows:
example one:
in this example, the service agent terminal obtains an agent request carrying a terminal identifier sent by a terminal device, and generates an account identification code uniquely corresponding to the terminal identifier, so that the account identification code uniquely corresponds to the terminal identifier, and account identification codes generated by different terminal devices are different, for example, as shown in fig. 2, account identification codes allocated by the service agent terminal to the terminal device 1 and the terminal device 2 are different, so that a service processing result can be fed back in a targeted manner during subsequent service processing, and the service agent terminal stores the account identification code locally and feeds back the account identification code to the terminal device, so that the subsequent terminal device can perform a service agent request based on the account identification code.
Example two:
in this example, after acquiring a proxy request sent by a terminal device, a service agent terminal sends an account identification code to the terminal device according to the proxy request, where the account identification code corresponds to a terminal identifier of the service agent terminal, for example, as shown in fig. 3, the terminal identifier of the service agent terminal is sent, and the same terminal identifier is fed back for terminal device 1 and terminal device 2, and thus, the account identification code sent by each service agent terminal is the same, and the account identification codes sent by different service agent terminals are different, so that after acquiring a service processing request, it can be determined whether the service agent authority is possessed by determining whether the account identification code is consistent with the terminal identifier of the terminal device.
And 103, if the service agent authority with the account identification code is acquired, executing corresponding processing operation in the block chain according to the service identification.
Specifically, if the service agent authority with the account id is known, corresponding processing operation is executed in the blockchain according to the service identifier, that is, the agent terminal device executes a corresponding service in the blockchain according to the blockchain account of the agent terminal device in the blockchain, as a possible example, service content and a target blockchain node are extracted according to the service identifier, corresponding information interaction is performed with the target blockchain node according to the service content, for example, the service content extracted according to the service identifier sent by the terminal device 1 is to send a file a to the blockchain node 2, and the file a is broadcast to the blockchain node 2 in the blockchain.
And 104, receiving the processing result fed back by the block chain, and performing service response on the terminal equipment according to the processing result.
Specifically, in order to improve the participation of the terminal device, the processing result fed back by the block chain is received, and a service response is performed on the terminal device according to the processing result, as a possible example, when the processing result is feedback information of a simple service interaction result, such as "file sending success", and the like, the feedback information is sent to the corresponding terminal device, as a possible example, when the processing result relates to an operation on the terminal device, the corresponding operation is performed on the terminal device, for example, when the processing result is that a corresponding bonus is allocated to the terminal device, the corresponding bonus is allocated to the terminal device, and of course, a part of agent fee and the like may be deducted.
Certainly, in practical applications, considering that many terminal devices may rely on a large number of proxy service terminals to perform illegal tasks due to the reduction of the registration threshold, for example, a plurality of proxy service terminals are used to flush traffic, and in order to avoid such a behavior, in an embodiment of the present invention, a service proxy terminal broadcasts a terminal identifier of a terminal device that is proxied to the service proxy terminal to a block chain, and when a service proxy terminal recorded in a block in the block chain and directed to the same terminal identifier exceeds a preset threshold, for example, exceeds 1 or 10, a relevant monitoring node in the block chain may prohibit proxy information from a block chain account transmitter corresponding to the service proxy terminal, so that the service proxy terminal denies service proxy to the corresponding terminal device.
To sum up, the service proxy method based on the block chain according to the embodiment of the present invention obtains a service processing request carrying an account identification code and a service identifier sent by a terminal device, and detects whether the service proxy request has a service proxy authority of the account identification code according to a local proxy account, if the service proxy authority having the account identification code is obtained, corresponding processing operation is executed in the block chain according to the service identifier, and finally, a processing result fed back by the block chain is received, and a service response is performed on the terminal device according to the processing result. Therefore, the corresponding service can be executed in the block chain without registration, the registration threshold is reduced, the flexibility of the block chain is improved, and the popularization of the block chain is facilitated.
In order to implement the foregoing embodiment, an embodiment of the present invention further provides a service agent apparatus based on a block chain. Fig. 4 is a schematic structural diagram of a service broker apparatus based on a blockchain according to an embodiment of the present invention, and as shown in fig. 4, the service broker apparatus based on a blockchain includes: a first acquisition module 100, a detection module 200, a service execution module 300 and a service feedback module 400, wherein,
the first obtaining module 100 is configured to obtain a service processing request which is sent by a terminal device and carries an account identification code and a service identifier.
The detecting module 200 is configured to detect whether the service agent authority has an account identification code according to a local proxy account.
And the service execution module 300 is configured to, if the service agent authority having the account identification code is obtained, execute corresponding processing operation in the block chain according to the service identifier.
And a service feedback module 400, configured to receive the processing result fed back by the block chain, and perform a service response on the terminal device according to the processing result.
In one embodiment of the present invention, as shown in fig. 5, on the basis of that shown in fig. 4, the apparatus comprises: a second acquisition module 500 and a first proxy module 600, wherein,
the second obtaining module 500 is configured to obtain an agent request with a terminal identifier sent by a terminal device, and generate an account identification code uniquely corresponding to the terminal identifier.
The first agent module 600 is configured to locally store the account identification code, and feed back the account identification code to the terminal device.
In one embodiment of the present invention, as shown in fig. 6, on the basis of that shown in fig. 4, the apparatus comprises: a third acquisition module 700 and a second proxy module 800, wherein,
a third obtaining module 700, configured to obtain an agent request sent by a terminal device.
The second proxy module 800 is configured to send an account identification code to the terminal device according to the proxy request, where the account identification code corresponds to the terminal identifier of the service proxy terminal.
It should be noted that the foregoing explanation of the embodiment of the service proxy method based on a block chain is also applicable to the service proxy apparatus based on a block chain in this embodiment, and therefore is not described herein again.
To sum up, the service agent apparatus based on the block chain according to the embodiment of the present invention obtains a service processing request carrying an account identification code and a service identifier sent by a terminal device, and detects whether the service agent apparatus has a service agent authority of the account identification code according to a local proxy account, if the service agent authority having the account identification code is obtained, corresponding processing operation is executed in the block chain according to the service identifier, and finally, a processing result fed back by the block chain is received, and a service response is performed on the terminal device according to the processing result. Therefore, the corresponding service can be executed in the block chain without registration, the registration threshold is reduced, the flexibility of the block chain is improved, and the popularization of the block chain is facilitated.
In order to implement the foregoing embodiments, an electronic device is further provided in an embodiment of the present application, including a processor and a memory;
wherein, the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the service brokering method based on the block chain as described in the above embodiments.
FIG. 7 illustrates a block diagram of an exemplary electronic device suitable for use in implementing embodiments of the present application. The electronic device 12 shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in FIG. 7, electronic device 12 is embodied in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. These architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus, to name a few.
Electronic device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 28 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 30 and/or cache Memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 7, and commonly referred to as a "hard drive"). Although not shown in FIG. 7, a disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk Read Only Memory (CD-ROM), a Digital versatile disk Read Only Memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the application.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally perform the functions and/or methodologies of the embodiments described herein.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with electronic device 12, and/or with any devices (e.g., network card, modem, etc.) that enable electronic device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public Network such as the Internet) via the Network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing, for example, implementing the methods mentioned in the foregoing embodiments, by executing programs stored in the system memory 28.
In order to implement the foregoing embodiments, the present application further proposes a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the non-transitory computer-readable storage medium implements the service brokering method based on the blockchain as described in the foregoing embodiments.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.