Machine function configuration method, device, computer readable medium and equipment
1. A machine function configuration method applied to a server is characterized by comprising the following steps:
receiving configuration information sent by a machine to be configured, wherein the configuration information comprises: configuring a function to be configured of a machine to be configured according to the configuration information and generating a configuration file;
encrypting the configuration file to generate an encrypted file;
and transmitting the encrypted file to the machine to be configured so that the machine to be configured decrypts the encrypted file to generate a plaintext file, and completing configuration of the function to be configured based on the plaintext file.
2. The machine function configuration method according to claim 1, wherein the configuring the function to be configured of the machine to be configured according to the configuration information to generate a configuration file includes:
determining a function item to be activated according to the function information to be configured;
acquiring a corresponding configuration option of a machine to be configured according to the machine identifier;
and selecting the functional items to be activated in the configuration options, and generating a configuration file based on the selected functional items to be activated.
3. The machine function configuration method of claim 1, wherein the encrypting the configuration file to generate an encrypted file comprises:
indexing the configuration options corresponding to the machine to be configured;
determining a first binary number corresponding to the configured configuration option;
and carrying out encryption operation on the first binary number to obtain a binary encrypted file.
4. The machine function configuration method according to claim 3, wherein the indexing of the configuration options corresponding to the machine to be configured comprises:
and taking the machine identification as a key value of an encryption operator to index the configuration option corresponding to the machine to be configured.
5. The machine function configuration method according to claim 3, wherein the encryption operation is in particular a shift and bitwise OR; the method specifically comprises the following steps:
translating each binary digit of the first binary digit to obtain a second binary digit;
and performing phase OR on the second binary number and the binary bit corresponding to the first binary number to obtain a binary encrypted file.
6. A method for configuring machine functions, applied to a machine, the method comprising:
sending configuration information to a server, the configuration information comprising: the server is used for configuring the function to be configured of the machine to be configured according to the configuration information to generate a configuration file; encrypting the configuration file to generate an encrypted file;
and receiving the encrypted file sent by the server, decrypting the encrypted file to generate a plaintext file, and completing the configuration of the item to be configured based on the plaintext file.
7. The machine function configuration method according to claim 6, wherein the decrypting the encrypted file generates a plaintext file, and the configuring of the item to be configured is completed based on the plaintext file, and includes:
and judging whether the configuration information contained in the plaintext file is consistent with the configuration information stored in the plaintext file, and if so, configuring the item to be configured based on the plaintext file.
8. A machine function configuration apparatus, comprising:
the generating module is used for receiving configuration information sent by a machine to be configured, and the configuration information comprises: configuring a function to be configured of a machine to be configured according to the configuration information and generating a configuration file;
the encryption module is used for encrypting the configuration file to generate an encrypted file;
and the configuration module is used for transmitting the encrypted file to the machine to be configured so as to enable the machine to be configured to decrypt the encrypted file to generate a plaintext file, and completing configuration of the function to be configured based on the plaintext file.
9. A computer-readable storage medium, storing a computer program which, when executed by a processor, causes the processor to carry out the steps of the method according to any one of claims 1 to 7.
10. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1 to 7.
Background
In order to meet market demands, that is, different users activate functions to be opened according to demands for machine configuration, in the prior art, each function item is usually opened through a special function interface, and a user enters a function item matching interface through a password to select and activate the functions to be activated, but as the user may be a non-professional person, the function item of the machine is randomly configured or wrongly operated, so that the machine fails to be normally used, and convenience and safety for the user to use cannot be guaranteed; meanwhile, since the user enters the function item matching interface through the password, the user selects and matches the function items by himself, which may cause leakage of all the function items and business loss.
Disclosure of Invention
In view of the above, it is necessary to provide a method, an apparatus, a computer readable medium and a device for configuring a machine function with high security.
A machine function configuration method is applied to a server, and the method comprises the following steps:
receiving configuration information sent by a machine to be configured, wherein the configuration information comprises: configuring a function to be configured of a machine to be configured according to the configuration information and generating a configuration file;
encrypting the configuration file to generate an encrypted file;
and transmitting the encrypted file to the machine to be configured so that the machine to be configured decrypts the encrypted file to generate a plaintext file, and completing configuration of the function to be configured based on the plaintext file.
In an embodiment, the configuring, according to the configuration information, a function to be configured of the machine to be configured to generate a configuration file includes:
determining a function item to be activated according to the function information to be configured;
acquiring a corresponding configuration option of a machine to be configured according to the machine identifier;
and selecting the functional items to be activated in the configuration options, and generating a configuration file based on the selected functional items to be activated.
In one embodiment, the encrypting the configuration file to generate an encrypted file includes:
indexing the configuration options corresponding to the machine to be configured;
determining a first binary number corresponding to the configured configuration option;
and carrying out encryption operation on the first binary number to obtain a binary encrypted file.
In an embodiment, the indexing each configuration option corresponding to the machine to be configured includes:
and taking the machine identification as a key value of an encryption operator to index the configuration option corresponding to the machine to be configured.
In one embodiment, the encryption operation is specifically a shift and a bitwise or; the method specifically comprises the following steps:
translating each binary digit of the first binary digit to obtain a second binary digit;
and performing phase OR on the second binary number and the binary bit corresponding to the first binary number to obtain a binary encrypted file.
A machine function configuration method is applied to a machine end, and comprises the following steps:
sending configuration information to a server, the configuration information comprising: the server is used for configuring the function to be configured of the machine to be configured according to the configuration information to generate a configuration file; encrypting the configuration file to generate an encrypted file;
and receiving the encrypted file sent by the server, decrypting the encrypted file to generate a plaintext file, and completing the configuration of the item to be configured based on the plaintext file.
In one embodiment, the decrypting the encrypted file to generate a plaintext file, and completing the configuration of the item to be configured based on the plaintext file includes:
and judging whether the configuration information contained in the plaintext file is consistent with the configuration information stored in the plaintext file, and if so, configuring the item to be configured based on the plaintext file.
An apparatus for machine function configuration, comprising:
the generating module is used for receiving configuration information sent by a machine to be configured, and the configuration information comprises: configuring a function to be configured of a machine to be configured according to the configuration information and generating a configuration file;
the encryption module is used for encrypting the configuration file to generate an encrypted file;
and the configuration module is used for transmitting the encrypted file to the machine to be configured so as to enable the machine to be configured to decrypt the encrypted file to generate a plaintext file, and completing configuration of the function to be configured based on the plaintext file.
An apparatus for machine function configuration, comprising:
a generating module, configured to send configuration information to a server, where the configuration information includes: the server is used for configuring the function to be configured of the machine to be configured according to the configuration information and generating a configuration file
The encryption module is used for encrypting the configuration file to generate an encrypted file;
and the configuration module is used for receiving the encrypted file sent by the server, decrypting the encrypted file to generate a plaintext file, and completing the configuration of the item to be configured based on the plaintext file. A computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of:
receiving configuration information sent by a machine to be configured, wherein the configuration information comprises: configuring a function to be configured of a machine to be configured according to the configuration information and generating a configuration file;
encrypting the configuration file to generate an encrypted file;
and transmitting the encrypted file to the machine to be configured so that the machine to be configured decrypts the encrypted file to generate a plaintext file, and completing configuration of the function to be configured based on the plaintext file.
A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of:
receiving configuration information sent by a machine to be configured, wherein the configuration information comprises: configuring a function to be configured of a machine to be configured according to the configuration information and generating a configuration file;
encrypting the configuration file to generate an encrypted file;
and transmitting the encrypted file to the machine to be configured so that the machine to be configured decrypts the encrypted file to generate a plaintext file, and completing configuration of the function to be configured based on the plaintext file.
According to the method and the system, the server configures the functional items of the machine to be configured according to the configuration information sent by the machine to be configured, so that the business loss caused by leakage of all the functional items due to manual intervention is avoided; meanwhile, the normal use of the machine is ensured, and the experience of the user is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Wherein:
FIG. 1 is a diagram of an application environment for a method of configuring machine functions in one embodiment;
FIG. 2 is a flow diagram illustrating a method for configuring machine functions in one embodiment as applied to a server;
FIG. 3 is a flow chart illustrating a method for configuring machine functionality as applied to a machine in one embodiment;
FIG. 4 is a block diagram showing the structure of a machine function configuration apparatus according to an embodiment;
FIG. 5 is a block diagram of a computer device in one embodiment.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
FIG. 1 is a diagram of an exemplary application environment for a method for configuring machine functions. Referring to fig. 1, the machine function configuration method is applied to a machine function configuration system. The machine function configuration system includes a terminal 110 and a server 120. The terminal 110 and the server 120 are connected through a network, the terminal 110 may be specifically a desktop terminal or a mobile terminal, and the mobile terminal may be specifically at least one of a mobile phone, a tablet computer, a notebook computer, and the like. The server 120 may be implemented as a stand-alone server or a server cluster composed of a plurality of servers. The terminal 110 is configured to send configuration information to the server, where the configuration information includes: the server is used for configuring the function to be configured of the machine to be configured according to the configuration information to generate a configuration file; encrypting the configuration file to generate an encrypted file; the server 120 is configured to receive configuration information sent by a machine to be configured, where the configuration information includes: and configuring the function to be configured of the machine to be configured according to the configuration information to generate a configuration file.
In one embodiment, as shown in FIG. 2, a method of configuring a machine function is provided. The method is applied to a server, and the embodiment is exemplified by being applied to the server. The machine function configuration method specifically comprises the following steps:
step 101, receiving configuration information sent by a machine to be configured, wherein the configuration information comprises: configuring a function to be configured of a machine to be configured according to the configuration information and generating a configuration file;
the machine identification is an identity identification code when the machine leaves a factory and can be obtained through a machine specification; the function information to be configured is a function item which needs to be configured for realizing certain functions of the machine to be configured; the purpose of configuring the machine to be configured is to improve the performance of the machine to be configured;
after the server receives configuration information sent by a machine to be configured, business personnel log in the server to perform configuration operation of functions to be configured, and determine function items to be activated according to the function information to be configured; and acquiring a configuration option corresponding to the machine to be configured according to the machine identifier, selecting the function item to be activated in the configuration option, and generating a configuration file based on the selected function item to be activated after configuration is completed.
Step 102, the server encrypts the configuration file to generate an encrypted file;
in order to improve the security of the function configuration of the machine to be configured, the configured configuration file needs to be encrypted to generate an encrypted file.
The server takes the machine identification as a key value of an encryption operator to index a configuration option corresponding to the machine to be configured; determining a first binary number corresponding to the configured configuration option, namely marking the selected function item to be activated in the configuration option as 1 and marking the unselected function item as 0, so as to obtain the first binary number corresponding to the configuration option;
carrying out shifting and bitwise OR encryption operation on the first binary number; where shifting is one of the bit manipulation operators, the numbers can be translated on a binary basis. Bitwise OR refers to the binary OR of two numbers involved in the operation. The result bit is 1 as long as one of the two corresponding bins is 1. When the number involved in the operation is negative, the two numbers involved appear with complement
The method specifically comprises the following steps: firstly, each binary digit of the first binary digit is translated leftwards or rightwards to obtain a second binary digit; and performing phase OR on the second binary number and the binary bit corresponding to the first binary number to obtain a binary encrypted file.
Step 103, transmitting the encrypted file to the to-be-configured machine, so that the to-be-configured machine decrypts the encrypted file to generate a plaintext file, and completes configuration of the to-be-configured function based on the plaintext file.
Wherein, after the encrypted file is transmitted to the machine to be configured, the machine to be configured analyzes the encrypted file, the encrypted file is decrypted and inversely operated to obtain a plaintext file, configuration options are obtained in the plaintext file, the configuration options correspond to the function items one by one, the configuration options are obtained by arranging and combining each function item in a bit mode, eight bits are a group of configuration options, the state of each bit is analyzed to obtain the activation state of the function item in the configuration option, the analyzed function item is analyzed through a machine identifier, wherein the configuration information also comprises configured function information, whether the initially sent configuration function information, the machine identifier, the configuration information and the function information to be configured are consistent or not is judged according to the configured function information, the machine identifier, the configuration information and the function information to be configured in the analyzed plaintext file, and if the configuration options are consistent, the plaintext file is valid, and the corresponding function is activated for the machine to be configured.
As shown in fig. 3, a method for configuring a machine function in another embodiment is applied to a machine side, and this embodiment is exemplified by being applied to the machine side, and the method for configuring a machine function specifically includes the following steps:
step 401: sending configuration information to a server, the configuration information comprising: the server is used for configuring the function to be configured of the machine to be configured according to the configuration information to generate a configuration file; and encrypting the configuration file to generate an encrypted file.
The method comprises the following steps that a machine to be configured sends configuration information to a server, wherein the configuration information comprises: configuring a machine identifier and function information to be configured of a machine to be configured according to the configuration information, and generating a configuration file, specifically: after the server receives configuration information sent by a machine to be configured, business personnel log in the server to perform configuration operation of functions to be configured, and determine function items to be activated according to the function information to be configured; and acquiring a configuration option corresponding to the machine to be configured according to the machine identifier, selecting the function item to be activated in the configuration option, and generating a configuration file based on the selected function item to be activated after configuration is completed.
The server takes the machine identification as a key value of an encryption operator to index a configuration option corresponding to the machine to be configured; determining a first binary number corresponding to the configured configuration option, namely marking the selected function item to be activated in the configuration option as 1 and marking the unselected function item as 0, so as to obtain the first binary number corresponding to the configuration option;
carrying out shifting and bitwise OR encryption operation on the first binary number; where shifting is one of the bit manipulation operators, the numbers can be translated on a binary basis. Bitwise OR refers to the binary OR of two numbers involved in the operation. The result bit is 1 as long as one of the two corresponding bins is 1. When the number involved in the operation is negative, both numbers are present in complement.
The method specifically comprises the following steps: firstly, each binary digit of the first binary digit is translated leftwards or rightwards to obtain a second binary digit; and performing phase OR on the second binary number and the binary bit corresponding to the first binary number to obtain a binary encrypted file.
Step 402: and receiving the encrypted file sent by the server, decrypting the encrypted file to generate a plaintext file, and completing the configuration of the item to be configured based on the plaintext file.
Wherein, after the machine to be configured receives the encrypted file sent by the server, the machine to be configured analyzes the encrypted file, the encrypted file is decrypted and inversely operated to obtain a plaintext file, configuration options are obtained in the plaintext file, the configuration options correspond to the function items one by one, the configuration options are obtained by arranging and combining each function item in a bit mode, eight bits are a group of configuration options, the state of each bit is analyzed to obtain the activation state of the function item in the configuration option, the analyzed function item is analyzed through a machine identifier, wherein the configuration information also comprises configured function information, whether the initially sent configuration function information, the machine identifier, the configuration information and the to-be-configured function information are consistent or not is judged according to the configured function information, the machine identifier, the configuration information and the to-be-configured function information in the analyzed plaintext file, and if the plaintext files are consistent with each other, activating the corresponding functions of the machine to be configured only if the plaintext files are valid.
In one embodiment, the decrypting the encrypted file to generate a plaintext file, and completing the configuration of the item to be configured based on the plaintext file includes:
and judging whether the configuration information contained in the plaintext file is consistent with the configuration information stored in the plaintext file, and if so, configuring the item to be configured based on the plaintext file.
In an embodiment, the present invention further provides a device for configuring machine functions, configured to implement a method for configuring machine functions applied to a server, as shown in fig. 4, which is a block diagram of a structure of the device for configuring machine functions, and includes:
a generating module 10, configured to receive configuration information sent by a machine to be configured, where the configuration information includes: configuring a function to be configured of a machine to be configured according to the configuration information and generating a configuration file;
the encryption module 20 is configured to encrypt the configuration file to generate an encrypted file;
the configuration module 30 is configured to transmit the encrypted file to the to-be-configured machine, so that the to-be-configured machine decrypts the encrypted file to generate a plaintext file, and completes configuration of the to-be-configured function based on the plaintext file;
in one embodiment, the generating module 10 is further configured to determine a function item to be activated according to the function information to be configured; acquiring a corresponding configuration option of a machine to be configured according to the machine identifier; and selecting the functional items to be activated in the configuration options, and generating a configuration file based on the selected functional items to be activated.
In an embodiment, the encryption module 20 is further configured to index a configuration option corresponding to the machine to be configured; determining a first binary number corresponding to the configured configuration option; and carrying out encryption operation on the first binary number to obtain a binary encrypted file.
In an embodiment, the encryption module 20 is further configured to use the machine identifier as a key value of an encryption operator to index a configuration option corresponding to the machine to be configured.
In one embodiment, the encryption operation is specifically a shift and a bitwise or;
the encryption module 20 is further configured to translate each binary bit of the first binary number to obtain a second binary number; and performing phase OR on the second binary number and the binary bit corresponding to the first binary number to obtain a binary encrypted file.
In another embodiment, the present invention further provides a device for configuring machine functions, which is used to implement a method for configuring machine functions applied to a machine side, and includes:
a generating module 10, configured to send configuration information to a server, where the configuration information includes: the server is used for configuring the function to be configured of the machine to be configured according to the configuration information and generating a configuration file
The encryption module 20 is configured to encrypt the configuration file to generate an encrypted file;
the configuration module 30 is configured to receive the encrypted file sent by the server, decrypt the encrypted file to generate a plaintext file, and complete configuration of the item to be configured based on the plaintext file.
In one embodiment, the generating module 10 is further configured to determine a function item to be activated according to the function information to be configured; acquiring a corresponding configuration option of a machine to be configured according to the machine identifier; and selecting the functional items to be activated in the configuration options, and generating a configuration file based on the selected functional items to be activated.
In an embodiment, the encryption module 20 is further configured to index a configuration option corresponding to the machine to be configured; determining a first binary number corresponding to the configured configuration option; and carrying out encryption operation on the first binary number to obtain a binary encrypted file.
In an embodiment, the encryption module 20 is further configured to use the machine identifier as a key value of an encryption operator to index a configuration option corresponding to the machine to be configured.
In one embodiment, the encryption operation is specifically a shift and a bitwise or;
the encryption module 20 is further configured to translate each binary bit of the first binary number to obtain a second binary number; and performing phase OR on the second binary number and the binary bit corresponding to the first binary number to obtain a binary encrypted file.
According to the method and the system, the server configures the functional items of the machine to be configured according to the configuration information sent by the machine to be configured, so that the business loss caused by leakage of all the functional items due to manual intervention is avoided; meanwhile, the normal use of the machine is ensured, and the experience of the user is improved.
FIG. 5 is a diagram illustrating an internal structure of a computer device in one embodiment. The computer device may specifically be a terminal, and may also be a server. As shown in fig. 5, the computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program that, when executed by the processor, causes the processor to implement the age identification method. The internal memory may also have a computer program stored therein, which when executed by the processor, causes the processor to perform the age identification method. Those skilled in the art will appreciate that the architecture shown in fig. 5 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.
A computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of:
receiving configuration information sent by a machine to be configured, wherein the configuration information comprises: configuring a function to be configured of a machine to be configured according to the configuration information and generating a configuration file;
encrypting the configuration file to generate an encrypted file;
and transmitting the encrypted file to the machine to be configured so that the machine to be configured decrypts the encrypted file to generate a plaintext file, and completing configuration of the function to be configured based on the plaintext file.
A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of:
receiving configuration information sent by a machine to be configured, wherein the configuration information comprises: configuring a function to be configured of a machine to be configured according to the configuration information and generating a configuration file; and encrypting the configuration file to generate an encrypted file.
It should be noted that the above-mentioned machine function configuration method, machine function configuration apparatus, computer device and computer readable storage medium belong to a general inventive concept, and the contents in the machine function configuration method, machine function configuration apparatus, computer device and computer readable storage medium embodiments are mutually applicable.
And transmitting the encrypted file to the machine to be configured so that the machine to be configured decrypts the encrypted file to generate a plaintext file, and completing configuration of the function to be configured based on the plaintext file.
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 a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
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 present application. 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.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:表单生成方法、装置、电子设备及存储介质